HTML CSS examples for CSS Widget:Table Cell
Set background color of table cells
<!doctype html> <html> <head> <style type="text/css"> td {<!-- w ww . j a va 2s . co m--> background-color:Chartreuse; } tr:nth-child(even)>td { background-color:yellow; } tr>td:first-child { background-color:blue; } </style> </head> <body> <table width="200" border="1"> <tbody> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </tbody> </table> </body> </html>