![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
table.a td:first-child { font-weight: bold; } table.b tr td:first-child { font-weight: bold; } table.c tr > td:first-child { font-weight: bold; } table.d > tr td:first-child { font-weight: bold; } table.e > tr > td:first-child { font-weight: bold; } The first three variations work in Netscape 7.01, Firefox 1.0, and Opera 7.54. The last two work in none of those browsers. |
#3
| |||
| |||
|
|
In article <306sjbF2ruo6aU1 (AT) uni-berlin (DOT) de>, Harlan Messinger <h.messinger (AT) comcast (DOT) net> wrote: table.a td:first-child { font-weight: bold; } table.b tr td:first-child { font-weight: bold; } table.c tr > td:first-child { font-weight: bold; } table.d > tr td:first-child { font-weight: bold; } table.e > tr > td:first-child { font-weight: bold; } The first three variations work in Netscape 7.01, Firefox 1.0, and Opera 7.54. The last two work in none of those browsers. I think you will find that there is an implicit tbody between a table and its tr - try 'table.f > tbody > tr ...'. Check with DOM Inspector or Web Developers toolkit. |
#4
| |||
| |||
|
|
Harlan Messinger wrote: I'm trying to bold-face the first column of a two column table. I try the following five variations (the five tables in the demo are assigned classes a, b, c, d, and e, respectively): table.a td:first-child { font-weight: bold; } table.b tr td:first-child { font-weight: bold; } table.c tr > td:first-child { font-weight: bold; } table.d > tr td:first-child { font-weight: bold; } table.e > tr > td:first-child { font-weight: bold; } The first three variations work in Netscape 7.01, Firefox 1.0, and Opera 7.54. The last two work in none of those browsers. Per the HTML recommendation, when <tbody> is not in the code, it is implied, much like </p> or </li> when those end tags are missing. (Take a look at the tree using the Mozilla DOM inspector and you'll see the tbody> element.) Try this instead: |
|
table.d > tbody tr td:first-child { font-weight: bold; } table.e > tbody tr > td:first-child { font-weight: bold; } BTW, I realize that this is just a test case, but what's wrong with the first 3 to do what you want? |
![]() |
| Thread Tools | |
| Display Modes | |
| |