|
Posted by Michael B Allen on 12/10/05 04:16
This question is a little OT but no doubt everyone and their brother is
generating tables here so heres my question.
I'm a little frustrated with CSS. Sure I can define styles for TH, TD,
and so on. But mildly sophisticated pages are buried in tables within
tables. Specifying global styles for these tags is useless. Likewise I
can define a class like:
..t {
font-size: small;
border-bottom: 1px lightgrey solid;
border-right: 1px lightgrey solid;
}
and add a class="t" to EVER SINGLE TH and TD tag like:
echo "<table cellpadding=\"0\" cellspacing=\"0\">";
echo "<tr><td class=\"t\">ID</td><td class=\"t\">Username</td><td class=\"t\">Name</td><td class=\"t\">Email</td><td class=\"t\">Options</td><td class=\"t\">Date</td>";
while ($row = mysql_fetch_row($result)) {
echo "<tr><td class=\"t\">$row[0]</td> <td class=\"t\">$row[1]</td> <td class=\"t\">$row[2]</td> <td class=\"t\">$row[5]</td> <td class=\"t\">$row[6]</td> <td class=\"t\">$row[7]</td> <tr/>";
}
echo "</table>";
but that is a total waste of bandwidth and typing. Also, it's just ugly.
What I *want* to do is define a class for TR or TABLE or better still
just add a DIV around the entire section I want to style and have it
affect the encosed region. What does the "cascade" in CSS stand for?
So can anyone recommend a method to this maddness?
Thanks,
Mike
Navigation:
[Reply to this message]
|