Hey All-
My second CSS question of the day. My previous question was resolved by having a proper DOCTYPE, but introduced a new error.
I have a table hierarchy I am trying to use to keep my life simple on the CSS side. I basically define an overall Table CSS Hierarchy that has 2 primary types, the main Table Definition and then a Definition for either a default Row/Column or a Header Row/Column.
The overall hierarchy looks like this:
table.FormTable { /* define main table style */ }
table.FormTable tr { /* define default table row style */ }
table.FormTable tr.Header { /* define header table row style */ }
table.FormTable tr td { /* define default table column style */ }
table.FormTable tr.header td { /* define header row table column style */ }
I know that I could define a unique class for each like:
.FormTableRow {}
.FormTableColumn {}
but I am trying to save some space in my files and make things easier on the HTML side.
This problem appeared immediately after getting the Doctype right. When I had an invalid Doctype and was operating in quirks mode, the above worked flawlessly in IE and FF, but now it fails in both.
I have also read in a few places that Multiple Inheritance in Tables doesn't always work, but I can't seem to find a direct answer to this problem in a couple of hours of searching (both these forums and the web).
Any help is greatly appreciated.
Why it's working will depend
Why it's working will depend on the styles you've omitted from your post. As for reducing code, you could help that by not creating a class for .Header but instead using <thead> and <th> tags, e.g.:
Table heading cell
Table heading cell
Table heading cell
Normal table cell
Normal table cell
Normal table cell
Well, yet another problem
Well, yet another problem solved through a simple check... I feel like an idiot today.
Turns out I was referencing the sub-class in all lower-case instead of partially upper and lower case.
Although, this does answer one question I had, whether or not CSS is case-sensitive: It is (I know, you all knew that).
Thanks again guys.
Have you switched to the
Have you switched to the head tags as Tyssen described?
I haven't switched to TH
I haven't switched to TH yet... but I am thinking about it.
From what I can tell, using is identical to except that it signifies that column as a Header column. In terms of CSS, it doesn't change a lot since I change the default anyways, but it is useful to keep in mind. I've see before and just dismissed it, but now I know what its for (which is always helpful).
I would change it, but I have a whole backend PHP application already written using tags that handles all this for me now. But, I will definitely keep that in mind for the future, now that I know what it does.
Thanks again guys for all the help.