相关疑难解决方法(0)

如何在ASP.NET RadioButtonList中的项之间添加空格

我有一个ASP.NET RadioButtonList,它使用RepeatDirection ="Horizo​​ntal"显示四个项目,以便在一行上显示它们.我正在使用RepeatLayout ="Flow"来避免表的标记.但是,这会导致列表中的项目彼此相邻放置,这看起来不太好.

因此,我尝试使用表格布局来利用CellSpacing和/或CellPadding属性.不幸的是,这些属性会影响表格中的垂直和水平间距/填充,所以当我得到水平间距时,我也会得到不希望的垂直间距.

在这一点上,我是这样的:

<asp:RadioButtonList ID="rblMyRadioButtonList" runat="server" 
    RepeatDirection="Horizontal"
    RepeatLayout="Flow" >
    <asp:ListItem Selected="false" Text="Item One&nbsp;&nbsp;&nbsp;&nbsp;" Value="Item_1" />
    <asp:ListItem Selected="false" Text="Item Two&nbsp;&nbsp;&nbsp;&nbsp;" Value="Item_2" />
    <asp:ListItem Selected="false" Text="Item Three&nbsp;&nbsp;&nbsp;&nbsp;" Value="Item_3" />
    <asp:ListItem Selected="false" Text="Item Four&nbsp;&nbsp;&nbsp;&nbsp;" Value="Item_4" />
</asp:RadioButtonList>
Run Code Online (Sandbox Code Playgroud)

......对我尖叫"你做得不对劲!"

完成此任务的正确方法是什么?

asp.net formatting markup radiobuttonlist

28
推荐指数
4
解决办法
11万
查看次数

标签 统计

asp.net ×1

formatting ×1

markup ×1

radiobuttonlist ×1