soycharliente Posted January 14, 2010 Share Posted January 14, 2010 Can anyone help me find a reference online where it says that tables cannot go inside paragraph tags? The output for the W3C Markup Validator reads: document type does not allow element "table" here Also reads: One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>"). I was doing a test to see if putting table inside p validated. However, I'm not putting a block-level element inside an inline element. I'm putting block-level inside block-level. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <body> <p> <table> <tr><td>hello</td><td>world</td><td>!</td></tr> </table> </p> </body> </html> I'm trying to find where the documentation addresses that. Thanks. Link to comment https://forums.phpfreaks.com/topic/188489-strict-doctype-tag-structure-w-table-and-p/ Share on other sites More sharing options...
soycharliente Posted January 14, 2010 Author Share Posted January 14, 2010 The only thing I can find thus far is this site (http://xhtml.com/en/xhtml/reference/) saying that p tags only allow inline elements. Guess that's good enough. Link to comment https://forums.phpfreaks.com/topic/188489-strict-doctype-tag-structure-w-table-and-p/#findComment-995127 Share on other sites More sharing options...
haku Posted January 14, 2010 Share Posted January 14, 2010 That's exactly what it is. You can't put block elements in a p tag. And besides, a table isn't a paragraph, so even if you could do that, it's semantically incorrect. Link to comment https://forums.phpfreaks.com/topic/188489-strict-doctype-tag-structure-w-table-and-p/#findComment-995242 Share on other sites More sharing options...
soycharliente Posted January 15, 2010 Author Share Posted January 15, 2010 Going to mark solved. If anyone HAS A LINK, feel free to post. Link to comment https://forums.phpfreaks.com/topic/188489-strict-doctype-tag-structure-w-table-and-p/#findComment-995252 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.