Ah… <col>
I’ve never used it. Mostly because
Mozilla gotz themselves confuzled by the specs way back in 1998 and so therefore is almost useless cross browser for most things… I guess width is one of the 4 things Mozilla actually works with though, so I guess you can use it.
I’ve discovered that I can set the widths of columns by setting the widths of the th’s on top… except IE7 wanted to limit to the width of content in the th (arg) and if content was longer/wider but couldn’t wrap (some really long Dutch word) then that didn’t work well either. But with short words, you could
.sometable thead th {
width: blah%;
}
assuming each colomn was headed by a th.
I dunno why you’d have a class on it though. You’ve got one on your table already.
.dat col {styles;}
The “span” is what the browser looks at, so css would only be good for things like background-color or something.
which I know is a no-no to have presentational in the html… but it’s easiest for me since I already have all those .w’s in my css because I use them to position all my side-by-side image divs - e.g. higher up on that page you’ll see:
<div class=“txtpic”>
<div class=“flft cnt w30”>img</div>
<div class=“frgt lft w65”>txt</div> <!–or could be another img–>
</div>
It looks like you are already comfortable with the non-presenataion riff-raff and confuzling names that come with grid systems… have you checked them out? They seem like something for you.
960 grid
Blueprint
etc
Also is there a way to stop table {font} from affecting the font-size of table th {font}?
Well, in general I don’t set fonts on things who don’t have their own text, except when I’m first setting fonts on the body.
So if most tables have a certain font size for th’s, td’s and captions, I’d just state them there.
No font setting on the table at all.
.dat th {
font for all th’s in the whatever with class of .dat;
}
or
table th {
fonts;
}
then
.specialtable th {
otherfonts;
}
and
table td {
fonts;
}
don’t even need “table” in front but might be more readable to you.
If you keep font settings on tables, and those font settings are % or em based, then know that setting is considered “100%” for children, so you’ll need to set higher numbers to get text to grow:
table {
font-size: .9em;
}
everything inside all tables is slightly smaller.
What is the default font-size for any td? 1em or 100%
and anything inside that td? also 1em or 100%… 100% of the table parent’s .9em though. So in both cases, the element thinks they are 1em or 100% but your eyes will see they are smaller than other elements on the page because the table shrunk everything first.
So what if you want a p in some td to be the equivalent of 1em?
It would have to be something larger than 1em.
So
table {
font-size: .9em;
}
td p.foo {
font-size: 1.2em; /or something/
}
1.2em is larger than the 1em it thinks it’s starting with (which, again, is really the parent’s .9em), so you try something bigger like 1.1em or 1.2em and now the text should not only be bigger than the others in the table but equal to (or maybe a bit bigger than) the text on the rest of the page (assuming that was all at 1em).
Since I suck at math, this is prolly why I don’t set fonts on boxes most of the time… I just set it on the particular element and then usually I don’t have to worry about parents and grandparents and percentages and calculations and weird stuff. Computers were invented to do the math junk FOR me.