I would like to give a css class to a row and i would like to make the first column black and the second column red. I dont want to use colgroup because this is a row specific action not whole table should be effected.
How do I change the background color for a column? To change the background color for a column, click on the column header in the grid and change the background color from the Font Control option available in Task menu.
To freeze the row/column we can use a simple HTML table and CSS. HTML: In HTML we can define the header row by <th> tag or we can use <td> tag also. Below example is using the <th> tag. We also put the table in DIV element to see the horizontal and vertical scrollbar by setting the overflow property of the DIV element.
Freeze columns and rows Select the cell below the rows and to the right of the columns you want to keep visible when you scroll. Select View > Freeze Panes > Freeze Panes.
You could use:
td { color: black; }
td:nth-child(2) { color: red; }
This is possible without CSS3 !
Sample
http://jsfiddle.net/Q3yu5/1/
CSS
tr.special_row td {
background-color: #000;
}
tr.special_row td + td {
background-color: #f00;
}
tr.special_row td+td+td {
background-color: #fff;
}
HTML
<table>
<tr class="special_row">
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
</table>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With