View Full Version : Please clarify: Does a CSS "display:table;" affect semantics?

02-25-2008, 06:46 PM
Hello all!

This thread is explicitly about:

Does the "display:table;" CSS attribute to a DIV element affect the way search engines "see" the content?

No, it does not:

No, the only thing that affects the semantics of a document is the HTML, not the CSS. So, making a <div> have display:table or a <table> have display:block won't affect the HTML at all.

That's one reason why display:table is available in the first place—to give elements the visual behavior of a table while allowing the proper element to be used for good semantics.

Why even post this thread after such a clear answer?

[...] display:table creates a semantic state in which you create tables that aren't really tables. There's no tabulation going on. Yes, this helps with screen readers and such that look at the semantic markup of the HTML, but such devices are becoming more and more intelligent and are starting to look at CSS as well.

see article (http://blogs.msdn.com/ie/archive/2006/02/02/523679.aspx#524756)

Would you advice a person, willing to comply with semantics rules, to not use "display: table;" if he has another alternative?
Thank you!

To Whom It May Concern:
Yes, this thread seems quite similar to one I posted a few hours ago. What I believe, is that the redefinition of the title and content of the thread justifies some "repetitions"

02-25-2008, 06:57 PM
Does a red coffee mug make it any less a coffee mug than a blue one?
Does a <div> with display:table make it any less a <div> than one with display:block?

If the content is a table, use a table.
If the content belongs in a division of the page, or you need a non-semantic, block-level element to provide a style hook, use a div.

If you are viewing a page with no stylesheets applied, no amount of display:anything is going to affect your document.

02-25-2008, 07:50 PM
Very well then..
Thank you!