CSS Table Height

Please Share On:

Definition:

CSS table height property specifies the height of the tables. See the below example of the different sizes of table height.

Syntax:

height: 100px;

Source Code:

<!DOCTYPE html>
<html>
<head>
<style>
table{
border-collapse: collapse;
}

table, th, td {
  border: 1px dashed red;
  height: 100px;
}
</style>
</head>

<body>
<h3>Example of CSS table height 100px </h3>

<table>
  <tr>
    <th>Roll No.</th>
    <th>First Name</th>
    <th>Last Name</th>
    <th>Hobby</th>
  </tr>
  <tr>
    <td>1.</td>
    <td>Harry</td>
    <td>Potter</td>
    <td>Acting</td>
  </tr>
  <tr>
    <td>2.</td>
    <td>Brad</td>
    <td>Pitt</td>
    <td>Acting</td>
  </tr>
</table>
</body>
</html>

Output: 100px height

Output:50px height

Output: 10px height




You may be interested in the following topics:

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright @2023. All Right Reserved.


Social media & sharing icons powered by UltimatelySocial