Works in IE but not in Opera or Firefox

J

John Dalberg

John Dalberg wrote


<bangs brucies head on desk />

Yes, *it is wrong*. You are applying display: block to an element where that
does not make sense. Table bodies can *not* be block level element. It does
not pull an error because it *is* syntactally correct. However it is most
certainly semantically incorrect. It's like saying body {display: inline;}.
Syntax is correct but what do you think a browser would do with it?

Just why do you want to turn a <tbody> element into a block level element in
the first place?

At the very least you should be using display: table-row-group (as per the
CSS specification, chapter 17).

Ideally you should omit the display property altogether and let the default
style sheet (appendix A in the spec) override the default display: inline
with display: table-row-group.

What's the proper way of hiding a few table rows in css as a default when a
page loads without resorting to Javascript?

John
 
R

rf

John Dalberg
What's the proper way of hiding a few table rows in css as a default when a
page loads without resorting to Javascript?

Oh my &deity are you being intentionally thick? Or perhaps you are either
not recieving my posts or just not reading them.

As I said yesterday:

<tbody style="display: none">

A better way (since you aren't using javascript and so can never make them
visible again) is to simply not put them there in the first place. I am sure
somebody in this thread or in your other one has suggested this.

And will you read my last post again and answer this bit:
Just why do you want to turn a <tbody> element into a block level element in
the first place?

If you do not interact with a post but merely plonk yet more questions at
the bottom, you are going to be very quickly ignored.
 
N

Neredbojias

Without quill or qualm, John Dalberg quothed:
What's the proper way of hiding a few table rows in css as a default when a
page loads without resorting to Javascript?

John

I don't think I get what you're trying to do. Just make a few rows
"invisible", as in not display?
 
M

Michael Winter

Sorry, I misread that.
That's a bad idea for reasons I gave in your last thread.

It's still a bad idea, but others have given the reasons in this thread.
My comments in your previous thread were for a related, but different,
reason.

Mike
 
M

Michael Winter

[snip]
Why do you think it doesn't display correcty [...]

Because Opera and Firefox are more reliable when it comes to proper
rendering than IE.

[snip]

[brucie:]
It's displaying how it should display correctly.

That isn't likely. As brucie said, what you want, and what you actually
coded for, are potentially different things. Opera and Firefox are much
more likely to represent the per-specification rendering of the mark-up
you produced, with IE representing what you would like. If true in this
case, it means your mark-up is incorrect with regard to the intent. Accept
that.

[snip]

Mike
 
M

Michael Winter

[snip]
What's the proper way of hiding a few table rows in css as a default
when a page loads without resorting to Javascript?

There is no "proper way" because you shouldn't do it. If you intend to use
scripting to show and hide rows, only scripting should do that.

What if the user agent hides the rows, but it cannot perform the script
actions to show them again? How are your users supposed to effectively
access the content?

As I've said previously, hide the rows with script. If they can be hidden
that way, you can be sure the user can show them again.

Mike
 
J

John Dalberg

[snip]
What's the proper way of hiding a few table rows in css as a default
when a page loads without resorting to Javascript?

There is no "proper way" because you shouldn't do it. If you intend to use
scripting to show and hide rows, only scripting should do that.

What if the user agent hides the rows, but it cannot perform the script
actions to show them again? How are your users supposed to effectively
access the content?

As I've said previously, hide the rows with script. If they can be hidden
that way, you can be sure the user can show them again.

Mike

I have a unique situation where the html is scraped by automated processes.
I don't need to show these rows to a human being but they need to be hidden
for a human being. Therefore Javascript is not needed. However on the
server side, based on some conditions, some rows are hidden and some rows
are shown. For the scraping process, it doesn't matter what is hidden or
not because it doesn't care.

So to show some rows I use <tbody style="display: table-row-group;">
and to hide some rows it's <tbody style="display: none;">. Is this correct?
I was using <tbody style="display: block;"> which I assumed was going to
work because it worked properly in IE.

If I need to hide/unhide for human beings, I use Javascript and change the
display attribute for tbody after giving it an id?


John Dalberg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top