border Attribute


 

Where to use the border Attribute

  • As Type Pixels:
    border is declared on the element: table

Description

The border attribute specifies the width of the frame around a table in pixels.

The border attribute is not present in the *W3C XHTML 1.1 Basic Tables Module.

In the absence of a border attribute, the default value for rules is "none" and the default value for frame is "void". Changing either of these latter attributes should have the specified effect.

If border="0", this keeps the default value of rules at "none" but fixes the value of frame at "void". This means that the border around the outside of the table is never shown, irrespective of the value assigned to the frame attribute in the code.

If border is given a non-zero value, this changes the default value of rules from "none" to "all" and the default value of frame from "void" to "border". This means that a table with a non-zero border attribute should be surrounded on all four sides by a border (with a width in pixels corresponding to this non-zero value) and also rules should be drawn between all table rows and columns. The exact borders which are visible can then theoretically be tuned using the frame and rules attributes. I have noticed inconsistencies when combining these three attributes, however. Taking a specific example: in Opera 9.6 for Linux, a non-zero border attribute seems to fix rules at "all", with other possible values being ignored.

Ref: *HTML 4.01 - Tables - Borders and rules

See also the rules and frame attributes.


Page Footer & Copyright

Copyright © Sally Maughan 2005-2009 (Page last updated on 16 May 2009)

*Valid XHTML 1.1 - hosted by *Openstrike

Content based on the W3C Working Draft: *XHTML 1.1 and Recommendation: *XHTML Modularisation 1.1.

W3C, XHTML, XML, HTML, CSS and MathML are *Trademarks of the W3C (*MIT, *ERCIM, *Keio) with which the site's author has no connection.


Up, Next & Previous Links

Your Location

Home > XHTML 1.1 Home > XHTML 1.1 Indexes > Attribute Index (XHTML 1.1) > border Attribute (XHTML 1.1)