🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to HTML Notes
Topic #30

Table Sizes


HTML tables can have different sizes for each column, row or the entire table.


Use the style attribute with the width or height properties to specify the size of a table, row or column.


HTML Table Width

To set the width of a table, add the style attribute to the <table> element:

Example

<table style="width:100%">

<tr>
    <th>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>
</table>

Note: Using a percentage as the size unit for a width means how wide will this element be compared to its parent element, which in this case is the <body> element.


HTML Table Column Width

To set the size of a specific column, add the style attribute on a <th> or <td> element:

Example

<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>
</table>

HTML Table Row Height

To set the height of a specific row, add the style attribute on a table row element:

Example

<table style="width:100%">

<tr>
    <th>Firstname</th>

    <th>Lastname</th>
    <th>Age</th>

</tr>

<tr style="height:200px">
    <td>Jill</td>

    <td>Smith</td>
    <td>50</td>

</tr>
  <tr>
    <td>Eve</td>

    <td>Jackson</td>
    <td>94</td>

  </tr>
</table>

Want to go beyond the notes?

Join CodingNow 2.0's HTML course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

Table Sizes – FAQs

Quick answers about learning Table Sizes in HTML.

This free note from CodingNow 2.0 explains Table Sizes in HTML — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every HTML topic on CodingNow 2.0, including Table Sizes, is 100% free with no signup required.
With focused practice, most students grasp Table Sizes in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now