/    Sign up×
Community /Pin to ProfileBookmark

Will nested tables validate?

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.

to post a comment
HTML

8 Comments(s)

Copy linkTweet thisAlerts:
@the_treeSep 17.2006 — It [I]might[/I] validate, I guess. But it would still be incorrect.
Copy linkTweet thisAlerts:
@CharlesSep 17.2006 — 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
Copy linkTweet thisAlerts:
@NogDogSep 17.2006 — 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:
[code=html]
<!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>
[/code]
Copy linkTweet thisAlerts:
@bluemoon562authorSep 18.2006 — 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.
Copy linkTweet thisAlerts:
@kiwibritSep 18.2006 — [url=http://www.shy.co.uk/Site-map.htm]Here's a page with nested lists[/url] that validates as HTML 4.01 strict.

I've been surprised to see in this thread that the concept is contentious.
Copy linkTweet thisAlerts:
@bluemoon562authorSep 18.2006 — 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.
Copy linkTweet thisAlerts:
@ray326Sep 18.2006 — 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.
Copy linkTweet thisAlerts:
@CharlesSep 18.2006 — 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.
×

Success!

Help @bluemoon562 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...