HTML table width attribute


An HTML table with a width of 400 pixels:
<table border="1" width="400">

Definition and Usage

The width attribute specifies the width of a table.
If the width attribute is not set, a table takes up the space it needs to display the table data.
For practical reasons, it may be better not to specify the width, and use CSS to apply the width instead.

Browser Support

The width attribute is supported in all major browsers.


<table width="value">

Attribute Values

Value Description
pixels Sets the width in pixels (example: width="50")
percent Sets the width in percent of the surrounding element (example: width="50%")
HTML table width attribute Reviewed by 1000sourcecodes on 02:21 Rating: 5
Powered by Blogger.