![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'ld want to hide a tag during display on screen and I want to show the tag when I print the page. How can I do please? |
#3
| |||||
| |||||
|
|
Use the classes "print-only" and "no-print" in your HTML and place this CSS in a stylesheet |
|
.print-only{ display: none; visibility: hidden; } |
|
/* Simple standards-based way to turn printing on */ .print-only { display: inherit; visibility: visible; } |
|
/* IE hack, because it doesn't support display: inherit; */ *.print-only { display: block; } |
|
tr.print-only { display: table-row; } |
#4
| |||||
| |||||
|
|
@media screen { .print-only { display: none; } } Problem solved? NO! |
|
I try to apply that you wrote but the result is to hide the content of the second <td> and not only the <td> tag |
|
I'ld wanted to display my tables into a single column on screen and into two columns printing the page to have printed one page only. |
|
I wrote here a little sample |
|
style |
#5
| |||||
| |||||
|
|
You cannot do that! |
|
If you remove a TD (which 'display: none' does ) your table will be buggered! |
|
Miss match on the number of TDs per row. |
|
You either have to put a element within the TD which you toggle the display, or not use tables! |
|
From your weird example with nested tables, it looks like you are using tables improperly anyway. |
#6
| |||
| |||
|
|
URL, please. |
| What? Are you really trying to hide _tags_ and not elements? (The confusion is common, but it was already correct in this thread. Please |
|
Are you really trying to hide _tags_ and not elements? |
#7
| |||
| |||
|
|
"Jukka K. Korpela" wrote [snipped] What? Are you really trying to hide _tags_ and not elements? It is not the some? please try to help me with a little sample Thank you |
#8
| ||||||
| ||||||
|
|
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). |
#9
| ||||||||
| ||||||||
|
|
Firstly, I did *not* full quote, |
|
If you remove a TD (which 'display: none' does ) your table will be buggered! Why do you think so? Removing a random TD from a table without compensating on other rows almost always buggers the table display across browsers... |
|
it is a common newbie question here with their abuse of row-and-column-span nested-tabled messes... |
|
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. Who really knows, |
|
instead of a real URL to a real example of what he is attempting with get this code snippet. |
|
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. Don't blame me, |
|
one can probably infer that with his real efforts that he is witnessing "odd" display result, else why would he post? |
|
How knows, can you real deduce what the real application is with nested: table><tr><td>Have a bad day?<td>yes</table table><tr><td>Have a bad day?<td>yes</table ?? |
#10
| |||
| |||
|
|
Scripsit Jonathan N. Little: Removing a random TD from a table without compensating on other rows almost always buggers the table display across browsers... ... And there is nothing in the odd concept that imples that the table will be "buggered". |
![]() |
| Thread Tools | |
| Display Modes | |
| |