Horje

How to vertical align content inside <tbody> (with CSS)

Vertical-align content in tbody

index.html
Example: HTML
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
  border: 1px solid black;
}
</style>
</head>
<body>

<h1>Vertical-align content in tbody</h1>

<table style="width:50%;">
    <tr>
      <th>Month</th>
      <th>Savings</th>
    </tr>
  <tbody style="vertical-align:bottom">
    <tr style="height:100px">
      <td>January</td>
      <td>$100</td>
    </tr>
    <tr style="height:100px">
      <td>February</td>
      <td>$80</td>
    </tr>
  </tbody>  
</table>

</body>
</html>

Output should be:

How to vertical align content inside <tbody> (with CSS)




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