On 12/6/2017 5:17 PM, Robert Prins wrote:
> It's allowed to leave out a few end tags in tables (like </th>, </td>, and
> </tr>) which would potentially make pages smaller. What's the general opinion on
> this?
>
> - go for it?
> - use, but with caution?
> - bad, it will break things?
>
> Robert
>
First of all, PointedEars' complaint is that you use "page" when I think
you mean "file". Omitting an optional end tag will not reduce the size
of the rendered Web page, but it will reduce the size of the HTML file.
Whether or not you use an optional end tag depends on what follows the
element specified by its beginning tag. Call the element in question A
and the following element B. If B is an element that can be embedded in
element A and alternatively can be outside of A, then you must omit A's
end tag if you intend to embed B; and you must specify A's end tab if
you do not intend to embed B.
All this is something you need to test with the W3C validator. You must
also view the results with at least two unrelated browsers.
--
David E. Ross
<
http://www.rossde.com/>
President Trump: Please stop using Twitter. We need
to hear your voice and see you talking. We need to know
when your message is really your own and not your attorney's.