My friend and I are doing something advance on html table tags on php.
We want to generate tags on php as engine but every time we add the ending tag the resulting render on the browser destroys the table layout because it is adding </td> at the end.
Questions
- It is possible to have td tags without ending tags? Is it really a
good practice? - Is there any work around because when he didn’t place
ending td tags the firebug is actually showing a complete td tag.
Omitting the
</td>tag is perfectly valid.In HTML4, the DTD says:
(The
Omeans the tag is optional)In HTML5, the spec says
If the rest of your mark-up is valid, then the browser parser will infer the end tag correctly in the appropriate place.
So, if adding the close tag is breaking your table, it’s a racing certainty that you’re doing something else wrong. If you post your mark-up we can guide you to what the problem is, otherwise I recommend that you validate your generated web page.