加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

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

发布时间:2020-12-16 00:35:22 所属栏目:asp.Net 来源:网络整理
导读:如何在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 whethe
如何在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>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读