如何在 ASP.NET 表中创建 thead 和 tbody?我需要这些标签,因为 jquery 和 asp.net 只给我 tr、th 和 td。
最佳答案
<罢工> asp:Table不支持这些元素。
Update: As jameh's answer reveals, the sentence above is completely wrong: the
TableSection
property allows to control whether a given row goes into the table's header, body or footer.
为了详细说明他的答案,似乎您甚至可以通过在标记中设置 TableSection
属性以声明方式实现此目的,而无需隐藏代码:
<asp:Table id="yourId" runat="server">
<asp:TableHeaderRow TableSection="TableHeader">
<!-- ... -->
</asp:TableHeaderRow>
<asp:TableRow>
<!-- 'TableSection' defaults to 'TableRowSection.TableBody'. -->
<!-- ... -->
</asp:TableRow>
<asp:TableRow TableSection="TableFooter">
<!-- ... -->
</asp:TableRow>
</asp:Table>
<小时/>
Original, now moot answer follows:
您可能想尝试 HtmlTable类代替:
<table id="yourId" runat="server">
<thead>
.
.
.
</thead>
<tbody>
.
.
.
</tbody>
</table>
关于jquery - 如何在 ASP.NET 表中创建 thead 和 tbody ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4015839/