W3C home > Mailing lists > Public > www-validator@w3.org > September 2015

Re: What is wrong with <td/>?

From: David Dorward <david@dorward.me.uk>
Date: Fri, 18 Sep 2015 14:05:31 +0100
To: "Roger W Haworth" <W@RHaworth.net>
Cc: www-validator@w3.org
Message-ID: <9CF24C49-39FA-4D6B-81D2-6B02927337B7@dorward.me.uk>
On 17 Sep 2015, at 13:59, Roger W Haworth wrote:

> In this page for example I use lots of self-closing <td/>s. When I declare the doctype to be HTML5 the validator says:
> Self-closing syntax (/>) used on a non-void HTML element. Ignoring the slash and treating as a start tag.
> I cannot see anything wrong with <td/>. Please tell the validator to stop rejecting it.

The specification only [allows the `/` character][1] at the end of start tags for [void elements][2] (where, in the HTML serialisation, it has no effect other than to satisfy people with an XML addiction) and foreign elements. `td` is clearly not listed among the the void elements and, being defined by HTML, it isn't a foreign element either.

The validator is correct.

[1]: http://www.w3.org/TR/html5/syntax.html#start-tags
[2] http://www.w3.org/TR/html5/syntax.html#void-elements

David Dorward
Received on Friday, 18 September 2015 13:06:13 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:59:51 UTC