Horje

Full Example of HTML Table Column Width

Set the width of the first column to 70%:
index.html
Example: HTML
<!DOCTYPE html>
<html>
<style>
table, th, td {
  border:1px solid black;
  border-collapse: collapse;
}
</style>
<body>

<h2>Set the first column to 70% of the table width</h2>

<table style="width:100%">
  <tr>
    <th style="width:70%">Firstname</th>
    <th>Lastname</th> 
    <th>Age</th>
  </tr>
  <tr>
    <td>Jill</td>
    <td>Smith</td>
    <td>50</td>
  </tr>
  <tr>
    <td>Eve</td>
    <td>Jackson</td>
    <td>94</td>
  </tr>
  <tr>
    <td>John</td>
    <td>Doe</td>
    <td>80</td>
  </tr>
</table>

</body>
</html>

Output should be:

Full Example of HTML Table Column Width



Related Articles
What is HTML Table Sizes HTML Table Sizes
How to edit HTML Table Width HTML Table Sizes
How to edit HTML Table Column Width HTML Table Sizes
How to edit HTML Table Row Height HTML Table Sizes

Single Articles

Type:
Html
Category:
Web Tutorial
Sub Category:
HTML Table Sizes
Uploaded by:
Admin



Share on: