Forum Moderators: not2easy
Is there a way to manipulate the first row of this table code using CSS without editing this html code:
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</table>
I was able to manipulate the first row of this table by changing the table code, and using this CSS code along with it:
HTML:
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<th></th>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</table>
CSS:
#pink th
{
background-color: #B17D63;
color: rgb(222, 184, 135);
}
However, I would like to just do this without editing the table html code to save time when I add tables through frontpage. Is this possible, and if so, how can I accomplish this? Thanks.
The best way to accomplish this is to do what your code points toward: add an ID or a CLASS name to the table row in each table. If you will be adding more such tables to the page or site through your WYSIWYG editor, use a class rather than an id, as it can be applied to as many elements on a single page as necessary. It's a little bit of a pain to have to add that class each time, but it's both reliable, and currently the only option.
html:
<table>
<tr class="first_row">
<td></td>
<td></td>
</tr>
etc...css:
.first_row{
/*styles for first row of table*/
}
cEM