Forum Moderators: open
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test</title>
</head>
<body>
<table>
<tr>
<td>
<td>
<p>
Test
</p>
</td>
</tr>
</table>
</body>
</html>
This also applies to some other elements like <p>, <li> etc. Some elements' closing and opening tags are optional in HTML eg <head>, <html>, <body>.
XML requires well-formed markup, so end tags are not optional in XHTML.
My pet peve in HTML:
...
<p>first paragraph text
<ul>
<li>first
<li>second
</ul>
"I don't obey any style"
<p>second paragraph text
...
If you create well formed input the error would get spotted immediately as there simply are no assumed close tags (at least not when validating, browsers unfortunately still will insert them)
The 'tagless' "I don't obey any style" will FAIL (under HTML 4.01 Strict)
Actually:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>untitled</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
</head>
<body>
<div>
<p>first paragraph text
<ul>
<li>first
<li>second
</ul>
"I don't obey any style"
<p>second paragraph text
</div>
</body>
</html>
Validates at [validator.w3.org...] without as much as a single warning.
I'm sure some out here will disagree and state you don't want to use xhtml
some previous WebmasterWorld discussion here:
Why most of us should NOT use XHTML [webmasterworld.com]