Easy Tutorial
❮ Html Reference Att Colgroup Width ❯

HTML <table> width Attribute

HTML <table> Tag

Example

An HTML table with a width of 400 pixels:


Browser Support

All major browsers support the width attribute.


Definition and Usage

The width attribute specifies the width of the table.

If the width attribute is not set, the table will take up the space needed to display the table data.

Tip: For practical purposes, it is best not to specify the width, but instead use CSS to apply width.


Syntax

Attribute Values

Value Description
pixels Sets the width in pixels (example: width="50").
% Sets the width as a percentage of the containing element (example: width="50%").

❮ Html Reference Att Colgroup Width ❯