I am trying to make my site fully w3c validator compliant.
At the moment, I am getting an error because a table which is generated programatically and insterted into a label's text attribute shows as a table nested in a span tag.
e.g
MyPage.aspx.vb
strHtml = "<table><tr><td>Hello World</td></tr></table>"
Me.myTable.Text = strHtml
MyPage.aspx
<asp:Label ID="myTable" runat="server" Text="testimonialTable"></asp:Label>
Renders as:
<span id="ctl00_Main_myTable">
<table><tr><td>Hello World</td></tr></table>
</span>
When I then validate my page at validator.w3.org I get the following error:
document type does not allow element "table" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.
I assume this is because I'm trying to put a block element (table) inside an inline element (span) - but I don't know how else to do this!
Anyone got any idea of a workaround?
Thanks,
Ben