Idocs Guide to HTML

Table Borders: BORDER, FRAME and RULES

For the next few pages we're going to use three <TABLE ...> attributes:

BORDER size of outside border
FRAME which outside borders are displayed
RULES which inside borders are displayed

These three attributes can get pretty confusing because they tend to change each other's defaults. For example, if you don't use BORDER then the default for RULES is NONE. However, if you do use BORDER (but only values greater than zero) or if you use any value of FRAME besides VOID then RULES defaults to ALL. Likewise, RULES changes FRAME's defaults.

To keep things simple it's usually a good idea to follow a simple rule: if you use either FRAME or RULES use them both and also use BORDER. That avoids confusion about what is defaulting to what. We'll follow that example in this guide. So, for example, to create a table with no inner borders we'll use all three attributes like this:


which gives us this table

watermelon grapes
peaches bananas

Copyright 1997-2002 Idocs Inc. Content in this guide is offered freely to the public under the terms of the Open Content License and the Open Publication License. Contents may be redistributed or republished freely under these terms so long as credit to the original creator and contributors is maintained.