Reply to Re: naming closing tags: <tr id="taggingtest">&nbsp</tr id="taggingtest">

Your name:

Reply:


Posted by Steve Pugh on 02/07/06 15:52

marcwentink@hotmail.com wrote:
> I wonder if the following is a legal thing to do:
>
> <tr id="taggingtest">&nbsp</tr id="taggingtest">

No.

> The reason for doing this is that I somehow want to comment which
> closing tag should in theory refer to which opening tag,

There should never be any doubt. The rules of HTML work in such a way
that a closing tag can only be associated with one opening tag. If
there's any doubt then that must be due to invalid code. (In XHTML
where all closing tags are required it's even more straightforward to
work out which closing tag belongs to which opening tag.)

> usefull if you
> have a large table, and several tables within a table.

There are very few cases where a table of data would contain another
table of data as part of its data. Are you abusing tables for layout
purposes?

> So it is a sort of comment I want to add, but then comment inside the
> closing tag.

Use a comment adjacent to the closing tag. Or adopt a system of
indenting that allows you to line up closing and opening tags and see
at a glance which one ends where. Many decent HTML editors will allow
you to select a whole element by clicking on its opening or closing
tag. So lots of ways to do what you want without making your code
invalid.

If you do want to put attributes in closing tags within your working
environment, make sure that you strip them out as part of your
deployment to your live environment.

Steve

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация