Coloring Rows in a Table : table row : Table Style HTML CSS TUTORIALS


HTML CSS TUTORIALS » Table Style » table row »

 

Coloring Rows in a Table


 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
  <meta http-equiv="Content-Type"
    content="text/html; charset=iso-8859-1" />
  <style type="text/css">
  .odd {
    background-color: lightgrey;
  }
  
  .even {
    background-color: yellow;
  }
  
  table {
    border: 1px solid black;
    border-spacing: 0;
  }
  
  td {
    padding: 4px 6px;
    border: 1px solid black;
  }
  </style>
</head>
<body>
  <table>
    <tr class="odd">
      <td> Row Cell </td>
      <td> Row Cell </td>
      <td> Row Cell </td>
    </tr>
    <tr class="even">
      <td> Row Cell </td>
      <td> Row Cell </td>
      <td> Row Cell </td>
    </tr>
    <tr class="odd">
      <td> Row Cell </td>
      <td> Row Cell </td>
      <td> Row Cell </td>
    </tr>
    <tr class="even">
      <td> Row Cell </td>
      <td> Row Cell </td>
      <td> Row Cell </td>
    </tr>
    <tr class="odd">
      <td> Row Cell </td>
      <td> Row Cell </td>
      <td> Row Cell </td>
    </tr>
    <tr class="even">
      <td> Row Cell </td>
      <td> Row Cell </td>
      <td> Row Cell </td>
    </tr>
    <tr class="odd">
      <td> Row Cell </td>
      <td> Row Cell </td>
      <td> Row Cell </td>
    </tr>
  </table>
</body>
</html

 



HTML code for linking to this page:

Follow Navioo On Twitter

HTML CSS TUTORIALS

 Navioo Table Style
» table row