并排制作 asp:CheckBoxList 个项目

Making asp:CheckBoxList Items Side By Side

我有一个问题,我无法在网上找到解决方案。我正在使用 asp CheckBoxList,但我有太多数据无法列出。我想在方框区域的 2 列中列出项目。我正在分享一张图片。请检查一下。那么我该怎么做呢?

重要的是;这个复选框列表从后面的代码动态填充。 html 页面上没有 ListItem。所以我不能设计它们。有什么想法吗?

<asp:CheckBoxList ID="AreaCheckBoxes" runat=server>

</asp:CheckBoxList>

您可以将 RepeatColumns property to 2 and the RepeatLayout 属性 设置为 Table

<asp:CheckBoxList ID="AreaCheckBoxes" 
                  RepeatColumns="2" 
                  RepeatLayout="Table" 
                  RepeatDirection="Vertical"
                  runat=server>
</asp:CheckBoxList>