Discussion: To hide a tag
Afficher un message
Vieux 09/03/2008, 11h49   #7
Jukka K. Korpela
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: To hide a tag

Scripsit Jonathan N. Little:

> You cannot do that!


Can't do what? Fullquoting obscures messages.

> If you remove a TD (which 'display: none' does )
> your table will be buggered!


Why do you think so?

> Miss match on the number of TDs per row.


And this means... the end of the world as we know it?

Such a mismatch might be bad style, but it does not violate any
specification. It might be unclear how such a table should be rendered,
but table rendering has many other browser-dependencies anyway.

Besides, in this case, the outer table has a single row, and the
structure of the inner tables is irrelevant, since the hiding takes
place at the outer level.

Now that you made me bothered to do the OPs job of setting up a copy of
the markup as an addressable document, it seems to do just what the OP
asked for - on IE 7. Maybe not on other browsers, but this might be due
to the missing end tags, or something.

> You either have to put a element within the TD which you toggle the
> display, or not use tables!


No, there's nothing illogical in the idea of making one column of a
table "hidden" by setting display: none. It might be slightly more
logical to set visibility: collapse, though.

> From your weird example with nested
> tables, it looks like you are using tables improperly anyway.


The example was weird, but my conjecture is that this is a fairly
harmless case of using a layout table. I have no idea why one of the
inner tables should appear in print but not on screen; it's normal to
want just the opposite (to hide a navigation bar in print).

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

  Réponse avec citation
 
Page generated in 0,05236 seconds with 9 queries