When you resize the HTML table in Design view of Visual
Studio .NET, and the table has the THEAD element and the TFOOT element, the HTML editor inserts the <tbody> tag in the table automatically. However, the editor does not add the corresponding </tbody> tag.
↑ Back to the top
To work around this problem, make sure that you add the <tbody> tag manually when the <tbody> tag is added automatically to the table
in the HTML file. You must add these tags in pairs to
avoid creating a malformed HTML file.
↑ Back to the top
Microsoft has confirmed that this is a bug in the Microsoft products that are
listed at the beginning of this article.
↑ Back to the top
Steps to Reproduce the Behavior
- Start Microsoft Visual Studio .NET.
- Create a new ASP.NET Web
Application project in the following location:
http://localhost/TestTable. By default, WebForm1.aspx is
created.
- Drag a
TABLE control from the
HTML tab in the toolbox to WebForm1.
- In Design view, right-click
WebForm1.aspx, and then click View HTML
Source.
- In WebForm1.aspx, add the THEAD element and the TFOOT element to the table.
- Paste the following sample code to complete the code of WebForm1.aspx:
<%@ Page%>
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="WebForm1" method="post" runat="server">
<TABLE id="Table1" style="Z-INDEX: 101; LEFT: 57px; WIDTH: 292px; POSITION: absolute; TOP: 216px; HEIGHT: 91px" cellSpacing="1" cellPadding="1" width="292" border="1">
<THEAD>
<TR>
<TD>Table Head</TD>
</TR>
</THEAD>
<TR>
<TD></TD>
</TR>
<TFOOT>
<TR>
<TD>Table Footer</TD>
</TR>
</TFOOT>
</TABLE>
</form>
</body>
</HTML>
- In HTML view, right-click
WebForm1.aspx, and then click View
Design.
- Make sure that the table header and the table footer appear
correctly.
- Drag the lower right corner of the
TABLE control to resize the table.
- In Design view, right-click
WebForm1.aspx, and then click View HTML
Source.
- Notice that the HTML editor has added the <tbody> tag
automatically. However, the HTML editor has not added the corresponding </tbody> tag to the code.
↑ Back to the top
For more information about the
HtmlTable control, visit the following Microsoft Web
site:
↑ Back to the top