我有一个ASP.NET RadioButtonList,它使用RepeatDirection ="Horizontal"显示四个项目,以便在一行上显示它们.我正在使用RepeatLayout ="Flow"来避免表的标记.但是,这会导致列表中的项目彼此相邻放置,这看起来不太好.
因此,我尝试使用表格布局来利用CellSpacing和/或CellPadding属性.不幸的是,这些属性会影响表格中的垂直和水平间距/填充,所以当我得到水平间距时,我也会得到不希望的垂直间距.
在这一点上,我是这样的:
<asp:RadioButtonList ID="rblMyRadioButtonList" runat="server"
RepeatDirection="Horizontal"
RepeatLayout="Flow" >
<asp:ListItem Selected="false" Text="Item One " Value="Item_1" />
<asp:ListItem Selected="false" Text="Item Two " Value="Item_2" />
<asp:ListItem Selected="false" Text="Item Three " Value="Item_3" />
<asp:ListItem Selected="false" Text="Item Four " Value="Item_4" />
</asp:RadioButtonList>
Run Code Online (Sandbox Code Playgroud)
......对我尖叫"你做得不对劲!"
完成此任务的正确方法是什么?