你好我是 c# 和 bootstrap 的新手,我想使用 gridview 像下图一样设置我的表格样式并使其响应,但我不知道如何实现它。
aspx代码:
<div class="table-responsive">
<asp:GridView runat="Server" id="data" CssClass="table table-hover table-bordered"/>
</div>
CSS 代码:
.table-responsive{
margin: 20px;
}
但是我的表的输出是这样的
最佳答案
您无法使用 GridView
实现该结构。您真正需要的是 FormView
。在 FormView
的 ItemTemplate
中定义一个包含所需标记的 table
。
MSDN 网址:Using the FormView's Templates
关于c# - 如何使用 GridView 创建每行 4 列的动态表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30657670/