Name

HEIGHT, WIDTH — NN all IE all HTML 3.2

Synopsis

HEIGHT=”length"
WIDTH=”length"

Optional

The rectangular dimensions of a cell that may be different from the default size as calculated by the browser. When the values for these attributes are less than the minimum space required to render the table cell content, the browser overrides the attribute settings to make sure that all content appears, even if it means that text lines word-wrap. You can also stretch the dimensions of a table beyond the browser-calculated dimensions. Extra whitespace appears inside table cells to make up the difference. If you specify just one of these attributes, the browser performs all necessary calculations to automatically adjust the dimension along the other axis.

Due to the regular nature of tables, if you set a custom height for one cell in a row, the entire row is set to that height; similarly, setting the width of a cell causes the width of all cells in the column to be the same size.

Both the HEIGHT and WIDTH attributes are deprecated in HTML 4.0 in favor of height and width style sheet attributes (which are not available for table cells in Navigator 4).

Example

<TH WIDTH="80%" HEIGHT=30>

Value

Any length value in pixels or percentage of available space.

Default

Based on content size.

Object Model Reference

IE

[window.]document.all.elementID.height

[window.]document.all.elementID.width

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.