Click to See Complete Forum and Search --> : Will nested tables validate?
bluemoon562
09-17-2006, 10:38 AM
I'm designing a complicated site that will use lots of Javascript, PHP and a database.
So, I am using tables. On some pages, the tables must be nested for the best effect.
However, I can't get those pages to validate. Now I'm "big on" getting pages to validate but don't know how it's possible to do so with those pages.
Is it possible? Has anyone validated nested tables?
Thanks.
the tree
09-17-2006, 11:23 AM
It might validate, I guess. But it would still be incorrect.
Charles
09-17-2006, 11:43 AM
Regarding HTML there are different types of wrong and there are different rules for each of the different kinds of HTML. In HTML 4.01 nesting TABLEs is valid, but non-conforming. In HTML 3.2 it is valid and conforming.
Your best bet, the one that will make your visitors happy, is to stop using TABLEs for layout in the first place and use HTML 4.01 Strict. http://www.w3.org/TR/REC-html40/
But you're not going to do that. Visitors do take a second place to our grand ideas for our web sites. So just use HTML 3.2 instead. http://www.w3.org/TR/REC-html32
NogDog
09-17-2006, 02:38 PM
Without a link and no indication of what validation errors you are getting, it's pretty difficult to help. As to whether it's possible for nested tables to validate, this validates with no warnings:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'>
<title>Page Title</title>
<!-- link rel='stylesheet' href='style.css' type='text/css' -->
<style type="text/css">
<!--
-->
</style>
</head>
<body>
<table>
<tr>
<td>
<table>
<tr>
<td>
This is a nested table.
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
bluemoon562
09-17-2006, 09:39 PM
Thank all of you for responding. I guess it is possible to validate a nested table in HTML 4. If not, I'll try HTML 3 for those pages.
I'm not savvy with CSS layouts yet - especially not for something this complicated. So, I will stick with tables for now. And the only way to get the look that I want is to go with something nested.
Thanks.
kiwibrit
09-18-2006, 06:03 AM
Here's a page with nested lists (http://www.shy.co.uk/Site-map.htm) that validates as HTML 4.01 strict.
I've been surprised to see in this thread that the concept is contentious.
bluemoon562
09-18-2006, 06:18 AM
It's controversial because many people are getting away from layered tables in favor of CSS layouts.
Nested lists is probably more acceptable than nested tables.
ray326
09-18-2006, 01:12 PM
As long as the defined HTML elements are used with correct syntax they will validate. How the elements are use to create a page is more philosophical in nature and I doubt there will ever be a validator for correct semantic use. Nested lists make semantic sense but nested tables seldom do.
Charles
09-18-2006, 01:59 PM
And in XHTML it is perfectly valid to nest A elements but that tends to confuse browsers. In an SGML DTD you can all all inline elements but A elements, XML doesn't have a syntax to express that. But the XHTML specifications tell you not to nest A elements and so nesting A elements in XHTML is said to be valid but non-conforming. Likewise to use TABLEs in this way is valid but non-conforming.