4 replies [Last post]
redwolf3
Offline
newbie
Sacramento, CA
Last seen: 15 years 3 weeks ago
Sacramento, CA
Timezone: GMT-8
Joined: 2006-11-16
Posts: 6
Points: 0

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.

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 7 years 7 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

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

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

redwolf3
Offline
newbie
Sacramento, CA
Last seen: 15 years 3 weeks ago
Sacramento, CA
Timezone: GMT-8
Joined: 2006-11-16
Posts: 6
Points: 0

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.

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 4 days 4 hours ago
Joined: 2004-06-30
Posts: 9679
Points: 815

Have you switched to the

Have you switched to the head tags as Tyssen described?

Verschwindende wrote:
  • CSS doesn't make pies

redwolf3
Offline
newbie
Sacramento, CA
Last seen: 15 years 3 weeks ago
Sacramento, CA
Timezone: GMT-8
Joined: 2006-11-16
Posts: 6
Points: 0

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.