jquery - 如何在 ASP.NET 表中创建 thead 和 tbody ?

标签 jquery asp.net html-table

如何在 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/

相关文章:

javascript - 有没有办法让两个 HTML ID 链接到一个 JavaScript 函数?

asp.net - 使用 .NET 向头部添加 CSS 链接

asp.net - 从按钮单击处理程序中的代码隐藏执行 ASP.NET 成员(member)登录

c# - 在 Windows 8.1 中启用 Windows 身份验证

css - 根据该元素中的值将 css 分配给该元素

javascript - 用字符填充表格行中的空白区域

php - PHP 中 MySQL 的 "Delete row"按钮

javascript - 正则表达式解决方案需要调试 jquery ajax 调用的奇怪行为

c# - 遍历通过 JQUERY 作为数组传入的对象并使用 c# webmethod 获取数据

javascript - jQuery - .each() 动态删除的行 - 编号关闭