如何让复选框列表出现在标签的右侧?
下拉列表出现在其标签的右侧,代码类似,但复选框列表出现在标签下方:
<p>
    <asp:Label ID="lblTestVersions" runat="server" Text="Toetsversie:" AssociatedControlID="DropDownListTestVersions"></asp:Label>
    <asp:DropDownList ID="DropDownListTestVersions" runat="server" Width="250" TabIndex="1" >
    </asp:DropDownList>
</p>
<p>
    <asp:Label ID="lblTests0" runat="server" Text="Opties:"></asp:Label>
    <asp:CheckBoxList ID="CheckBoxList1" runat="server" TabIndex="2" Width="200">
        <asp:ListItem Width="200">Option 1</asp:ListItem>
        <asp:ListItem Width="200">Option 2</asp:ListItem>
    </asp:CheckBoxList>
</p>
我试图用几个来限制复选框列表的宽度,Width="200"但这没有帮助。
答案(见下文)是 CheckBoxList 实际上是一个表,并且总是会转到下一行。