Page Widget How to - Style the first column








Question

We would like to know how to style the first column.

Answer


<!--from  www.j  a  v a  2 s. c o  m-->
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
table tr td:first-child {
  color: red;
}
</style>
</head>
<body>
  <table>
    <tr>
      <td>label</td>
      <td>value</td>
    </tr>
    <tr>
      <td>label</td>
      <td>value</td>
    </tr>
    <tr>
      <td>label</td>
      <td>value</td>
    </tr>
  </table>
</body>
</html>

The code above is rendered as follows: