0
<!DOCTYPE html>
<html>
<head>
    <title>Rocket Club</title>
    <style>
        table{
            height: 300% ;
            width: 80%;
        }
    </style>
</head>
<body>
    <table>
        <tr>
            <td rowspan="2" >
                This is 1st row 1st column
            </td>
            <td >
                2
            </td>
        </tr>
    </table>
</body>  
</html>

In the above simple code when im tring to change the height and width of the table by CSS, the width can be affected through using the '%' but where as height was not effected when used the '%'. and there is no problem when used 'cm' and 'px' to height. thank you.

  • 1
    It's because the height of a page is essentially undefined., the more content it gets, the 'higher' it will be so setting it to 100% doesn't really mean anything. If you want to set the page to the 100% height of the viewport then use 100vh (so 80% of viewport height is 80vh) – Adam Sep 03 '22 at 02:40
  • Nice explainer here https://www.freecodecamp.org/news/html-page-width-height/ – Adam Sep 03 '22 at 02:42

0 Answers0