/    Sign up×
Community /Pin to ProfileBookmark

HTML "assumptions" question

I’m looking at some html code that has several instances of <table> with NO associated </table> to end it.
However, the page shows up normally, ie. the tables are where they should be as though the proper </table> tags were there.
I am assuming that if you start a table, and then start another table without ever ending the first table, that the browser “assumes” that you forgot and just ends the table as if you had done it.
Is that true??

to post a comment
HTML

9 Comments(s)

Copy linkTweet thisAlerts:
@Daniel_TAug 14.2004 — No. If you start a table and then start another table, it is called a nested table, and the second table will be located inside the table. But if you forget the </table> tags, who knows what will happen!
Copy linkTweet thisAlerts:
@CharlesAug 14.2004 — Sort of. Strictly speaking, since the closing tag is required by the HTML DTD the behavior is undefined and the browser is free to do anything it wants. So always be certain that your page passes [url=http://validator.w3.org/]The Validator[/url].

But a lot of elements do have [url=http://www.w3.org/TR/html4/index/elements.html]optional end tags[/url]. Take the P element. Since it can only contain inline level elements, browsers are required to assume a closing tag when the opening tag for a block level element follows.
Copy linkTweet thisAlerts:
@grindyauthorAug 14.2004 — Thx for the reply and the link to The Validator...?
Copy linkTweet thisAlerts:
@BuezaWebDevAug 14.2004 — I used to code layouts in tables. I used to be fluent in coding layouts in tables. Now, I look at table coding and I go, "What the heck?"

Honestly, I hate table coding. It confuses me so much now because I've been working with CSS and only CSS. Table coding is just so inefficient and unsemantic for layouts.
Copy linkTweet thisAlerts:
@grindyauthorAug 16.2004 — [i]Originally posted by BuezaWebDev [/i]

[B]I used to code layouts in tables. I used to be fluent in coding layouts in tables. Now, I look at table coding and I go, "What the heck?"



Honestly, I hate table coding. It confuses me so much now because I've been working with CSS and only CSS. Table coding is just so inefficient and unsemantic for layouts. [/B]
[/QUOTE]


The table(s) structure that I've been working with, works in conjunction with a fairly complex style sheet - and it's still a mess. Or at least it seems so to me. But then I'm a novice, just learning...

After several hours trying to "untangle" (understand?)a single page, that went back and forth between the usual HTML table structure and it's associated CSS - I began to think that I'd never have the time or mental energy ( I'll be 60 next year, sheesh ) to get good at it.

So, I'm just compromising and making changes that suit me.

It's actually a phpBB "theme" that I'm working on...

Pain in the arse...
Copy linkTweet thisAlerts:
@Stephen_PhilbinAug 16.2004 — It can be pretty easy to miss an end tag, or even a start tag for that matter. The W3c validator is a godsend for making sure your code will work on most browsers though. Halthough an amazingly simple tool I made myself also helps. It's pretty crap really, I just made it to see how much pointless markup there was in the source of tabular pages. Just to have a look at a string function in php.

it's www.vagusnet.com/ste/counttags.html

Like I said it's pretty crap, if you want to count the <td> tags you have to tell it to count <td and not <td> because it'll not count tags that contain attributes if you do and so on. But I find it a handy quick checker to make sure the number of end tags match up to the number of start tags.

If you miss end table row or data tags in a table for example, IE will forgive the incompetent markup and display as the creator assumed it would, wheras other browsers will display the mark up for what it is.

Go ahead and use the counter if ya like. Just remeber its pretty crap and doesn't actually understand any code, it'll just count the number of times it sees whatever text you entered into one of the small boxes in the text you pasted into the big box. Like I said it was just a little test that I made for learning how to use a php function, but ya can use it for non validatory purposes as I do.

As for the proposition of "I'll bet I can show you something CSS can't do", I just laugh at that every time. I hear it so often it's just silly. I know full well the power and potential of CSS, it's just a shame i'm not yet skilled enough to rise to such challenges yet. CSS layouts still take me just as long to make as tabular ones do. Then only difference is that in time as my knowledge grows, the time to make pages will vastly decrease. Whereas if I had stayed with tables, it would have only remained the same.
Copy linkTweet thisAlerts:
@grindyauthorAug 19.2004 — I completly agree with you regarding the superiority of CSS over standard HTML tagging. I'm learning about and using it as quickly as I can grasp it...

Love the app you wrote for counting tags... Works quickly and does the job it's supposed to do.

Interestingly, this page had:
There are 59 instances of the tag "<tr>"

There are 66 instances of the tag "</tr>"[/quote]


How'd they do that? LOL

Love your sig...

take care, bob
Copy linkTweet thisAlerts:
@Stephen_PhilbinAug 19.2004 — Well like I said, it's very basic. If you ask it to count the <td>'s that's all it'll look for. It won't count any <td>'s that contain attributes like <td class="cost">

Telling it to search for <td though should catch all instances of <td>.
Copy linkTweet thisAlerts:
@CharlesAug 19.2004 — Or you can just use [url=http://tidy.sourceforge.net/]HTML Tidy[/url].
×

Success!

Help @grindy 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 5.19,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...