width Attributewidth Attributewidth is declared on the elements: object, img, tablewidth is declared on the elements: col, colgroupimg and
object elementsThe width attribute may be included on an
img or an object element
to specify the width of the element, either in pixels or as a percentage
of the available horizontal space (usually the parent element's width).
This attribute will override the
element's natural width and the image/object will be scaled to
attain this specified width. If no height
attribute is specified, the image/object's natural height will be scaled by the same factor,
maintaining aspect ratio.
The advantage of specifying width and height attributes
is that it informs the user agent in advance how big the
final rendered element will be. The correct space on the screen can be allocated
for it, avoiding the need to re-flow the page content once the image/object's
actual dimensions have been determined.
See also the height attribute.
table elementsThe width attribute may be included on a table
element to specify the desired width of the entire table,
either in pixels or as a percentage of the available horizontal space
(usually the parent element's width).
The W3C,
however, encourages authors to use style sheets
to specify table widths, rather than the width attribute.
If no width is specified the user agent will determine the width of the table based upon its contents and applicable styling.
col and
colgroup elementsFor more information, see the MultiLength attribute type.