微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何在ASP.NET表中创建thead和tbody?我需要这些标签,因为jquery和asp.net只给我tr,th和td。

解决方法

asp:Table不支持这些元素。

Update: As 07001 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>

原文地址:https://www.jb51.cc/aspnet/252661.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐