views:

38

answers:

1

How to create thead and tbody in ASP.NET Table ? I need those tags because of jquery and asp.net gives me only tr, th and td.

+3  A: 

asp:Table does not support these elements. You might want to try the HtmlTable class instead:

<table id="yourId" runat="server">
    <thead>
        .
        .
        .
    </thead>
    <tbody>
        .
        .
        .
    </tbody>
</table>
Frédéric Hamidi
What good is then this Asp:Table ? Can I create HtmlTable programaticly with C# code ?
Primoz
Yes, [you can](http://msdn.microsoft.com/en-us/library/wwhe0at8%28v=VS.80%29.aspx), even if the syntax is probably less clear.
Frédéric Hamidi
Out of curiosity, what good is then this Asp:Table ?
Primoz
`asp:Table` is consistent with other web server controls. It'normally easier to develop with than `HtmlTable`. See http://www.developerfusion.com/article/4410/in-depth-aspnet-using-adonet/3/.
Frédéric Hamidi