![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'd like to turn on and off table cells so I can display differening data. |
|
.some_row_class{ display: none; } |
|
.some_row_class{ display: table-cell; } |
#3
| |||||
| |||||
|
|
Jeff wrote: I'd like to turn on and off table cells so I can display differening data. Since you are apparently doing this with client-side scripting (why else would you ask?), why don't you simply manipulate the document tree? |
|
you depend on client-side scripting for some functionality, why would you _also_ depend on CSS support being enabled? .some_row_class{ display: none; } |
|
Your text and your heading refer to cells, but your dummy class name suggests that this is about rows. .some_row_class{ display: table-cell; } |
|
IE does not support any of the display property values that start with "table-". However, if you really want to make yourself dependent on CSS as well as scripting, why don't you use just the first one of the rules and dynamically change the class property of a cell or row to "some_row_class" or to something else, depending on whether you want it to be displayed or not? |
#4
| |||
| |||
|
|
Now that works fine in FireFox, but IE 6 chokes. display: block works in IE and fails in Firefox. |
#5
| |||||
| |||||
|
|
Since you are apparently doing this with client-side scripting (why else would you ask?), why don't you simply manipulate the document tree? Server side in this case. |
|
.some_row_class{ display: none; } Who turns that off? |
|
td>, I'm not actually using a class to call them. |
|
However, if you really want to make yourself dependent on CSS as well as scripting, why don't you use just the first one of the rules and dynamically change the class property of a cell or row to "some_row_class" or to something else, depending on whether you want it to be displayed or not? I think instead of turning on what I wanted, I'll turn off what I don't. |
|
Is there a way to set an "element" back to it's default? |
#6
| |||
| |||
|
|
Server side in this case. And, I've never found manipulating the DOM tree to be simple. That's a bit of code to extract data from a table and then rebuild it and it's contents and attributes. |
|
Is there a way to set an "element" back to it's default? Such as unsetting a width or in this case or display in this case. I can't find it. |
|
WARNING: Due to extreme spam, googlegroups.com is blocked. Due to ignorance | by the abuse department, bellsouth.net is blocked. If you post to | Usenet from these places, find another Usenet provider ASAP. | Phil Howard KA9WGN (email for humans: first name in lower case at ipal.net) | |
#7
| |||
| |||
|
|
On Wed, 26 Nov 2008 17:31:16 -0500 Jeff <jeff (AT) spam_me_not (DOT) com> wrote: [...] | Is there a way to set an "element" back to it's default? Such as | unsetting a width or in this case or display in this case. I can't find it. Have another document element not in the tree, cloned from the initial part of the tree as delivered in the original document, modified to have varied content, and just swap between them when desired. |
#8
| |||
| |||
|
|
To answer the original question, no you can't set style properties back to their defaults. In CSS3 you can set them back to their initial values (and some browsers may support this) by setting e.g. width: initial. |
#9
| |||
| |||
|
|
Ben C wrote: To answer the original question, no you can't set style properties back to their defaults. In CSS3 you can set them back to their initial values (and some browsers may support this) by setting e.g. width: initial. No but in effect you can by nulling the property. See my example that does work in poor IE... http://message-id.net/%3C7197$492dd44f$40cba7cb$8060 (AT) NAXS (DOT) COM%3E Message-ID.net : 7197$492dd44f$40cba7cb$8060 (AT) NAXS (DOT) COM |
#10
| |||
| |||
|
|
On 2008-11-29, Jonathan N. Little <lws4art (AT) central (DOT) net> wrote: Ben C wrote: To answer the original question, no you can't set style properties back to their defaults. In CSS3 you can set them back to their initial values (and some browsers may support this) by setting e.g. width: initial. No but in effect you can by nulling the property. See my example that does work in poor IE... http://message-id.net/%3C7197$492dd44f$40cba7cb$8060 (AT) NAXS (DOT) COM%3E Message-ID.net : 7197$492dd44f$40cba7cb$8060 (AT) NAXS (DOT) COM There you're just removing it from the style attribute-- it will still apply if it's in a CSS rule whose selector matches the element. |
|
I think I did mention that. But in any case yes that might be a perfectly good way for the OP to proceed. |
![]() |
| Thread Tools | |
| Display Modes | |
| |