Horje

How to set Style <thead>, <tbody>, and <tfoot> with CSS

The thead, tbody, and tfoot elements - Styled with CSS.

index.html
Example: HTML
<!DOCTYPE html>
<html>
<head>
<style>
thead {color:green;}
tbody {color:blue;}
tfoot {color:red;}

table, th, td {
  border: 1px solid black;
}
</style>
</head>
<body>

<h1>The thead, tbody, and tfoot elements - Styled with CSS</h1>

<table>
  <thead>
    <tr>
      <th>Month</th>
      <th>Savings</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>January</td>
      <td>$100</td>
    </tr>
    <tr>
      <td>February</td>
      <td>$80</td>
    </tr>
  </tbody>
  <tfoot>
    <tr>
      <td>Sum</td>
      <td>$180</td>
    </tr>
  </tfoot>
</table>

</body>
</html>

Output should be:

How to set Style <thead>, <tbody>, and <tfoot> with CSS




Type:
html
Category:
Web Tutorial
Sub Category:
HTML Tag
Uploaded by:
Admin