Computer >> Computer tutorials >  >> Programming >> Javascript

Usage of CSS table-layout property


The table-layout property is to help you control how a browser should render or lay out a table. This property can have one of the three values: fixed, auto or inherit.

Example

You can try to run the following code to implement CSS table-layout property

<html>
   <head>
      <style>
         table.auto {
            table-layout: auto
         }
         table.fixed{
            table-layout: fixed
         }
      </style>
   </head>
   <body>
      <table class = "auto" border = "1" width = "100%">
         <tr>
            <td width = "20%">1000000000000000000000000000</td>
            <td width = "40%">10000000</td>
            <td width = "40%">100</td>
         </tr>
      </table>
      <br />
      <table class = "fixed" border = "1" width = "100%">
         <tr>
            <td width = "20%">1000000000000000000000000000</td>
            <td width = "40%">10000000</td>
            <td width = "40%">100</td>
         </tr>
      </table>
   </body>
</html>