Easy Tutorial
❮ Att A Hreflang Canvas Fillrect ❯

HTML <th> width Attribute

HTML <th> Tag

Example

Table header cell with a predefined width:


Browser Support

All major browsers support the width attribute.


Definition and Usage

In HTML 4.01, the width attribute of <th> is deprecated.

The width attribute specifies the width of a header cell.

Usually, a cell takes up the space it needs to display its content. The width attribute is used to set a predefined width for the cell.


Compatibility Notes

In HTML 4.01, the width attribute of <th> is deprecated. Use CSS instead.

CSS syntax: <th style="width:100px">

CSS Example: Setting the width of a table header cell

In our CSS tutorial, you can find more details about the width property.


Syntax

Attribute Values

Value Description
pixels Sets the width in pixels (e.g., width="50").
% Sets the width as a percentage of the containing element (e.g., width="50%").
❮ Att A Hreflang Canvas Fillrect ❯