Deprecated in HTML5. Do not use.

<table rules="">

Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn more
Attribute of
Create An HTML Table Quickly & Easily With Our Code Example
What does <table rules=""> do?
Was used to specify the display of internal borders between rows and colums. This attribute has been deprecated. Use CSS to style table borders instead.
The Rules Attribute has been Deprecated This attribute has been deprecated and should not be used. Browser support for this attribute is limited and using it may produce unexpected results. Instead, use CSS to style tables.

The RULES Attribute

RULES, an HTML 4.0 attribute, indicates if there should be internal borders in the table. We’ll go over each of the values of RULES and demonstrate how they are used. RULES and FRAME have an annoying way of changing each other’s defaults. To simplify your life, here’s a rule of thumb: if you use RULES also use FRAME and BORDER. It’s easier to avoid getting confused.

The NONE Value for the RULES Attribute

RULES=NONE means that there are no inside borders. RULES=NONE is the default if you don’t use BORDER or set it to zero, but otherwise must be explicitly stated to have no inside borders. Note that currently Netscape does not recognize RULES.

<TABLE BORDER=2 RULES=NONE FRAME=BOX> 

When applied to a table, that value gives us this result:

NameFood
Starflowerstir fied tofu
Mikovegetable rice soup
Andyhummus
Pingfrench toast

The ALL Value for the RULES Attribute

RULES=ALL indicates that all the internal borders should be visible. RULES=ALL is usually used in conjunction with FRAME=VOID so that there are outer borders but no inner borders.

<TABLE BORDER=2 FRAME=VOID RULES=ALL> 

When applied to a table, that value gives us this result:

NameFood
Starflowerstir fied tofu
Mikovegetable rice soup
Andyhummus
Pingfrench toast

The COLS Value for the RULES Attribute

COLS indicates that there should be borders between the columns but not between rows.

<TABLE BORDER=2 RULES=COLS FRAME=BOX> 

When applied to a table, that value gives us this result:

NameFood
Starflowerstir fied tofu
Mikovegetable rice soup
Andyhummus
Pingfrench toast

The ROWS Value for the RULES Attribute

RULES=ROWS indicates that there should be borders between rows but not between columns.

<TABLE BORDER=2 RULES=ROWS FRAME=BOX> 

When applied to a table, that value gives us this result:

NameFood
Starflowerstir fied tofu
Mikovegetable rice soup
Andyhummus
Pingfrench toast

The GROUPS Value for the RULES Attribute

RULES=GROUPS allows you to put borders between groups of table cells. There are two ways cells can be grouped: by row and by column. Let’s go over each of them. Note that currently Netscape does not recognize RULES.

Grouping By Row

To group by row use the <THEAD ...>, <TBODY ...>, <TFOOT ...> tags. <THEAD ...> indicates the header rows of the table, <TBODY ...> indicates the main body of the table, and <TFOOT ...> indicates the bottom rows. So, for example, this code creates a table with three groups. Borders appear just between groups:

<TABLE BORDER=2 RULES=GROUPS>   <THEAD>     <TR><TH>Name</TH><TH>Food</TH><TH>Price</TH></TR>   </THEAD>   <TBODY>     <TR><TD>Starflower</TD><TD>stir fied tofu</TD><TD>5.95</TD></TR>     <TR><TD>Miko</TD><TD>vegetable rice soup</TD><TD>4.95</TD></TR>     <TR><TD>Andy</TD><TD>hummus</TD><TD>3.95</TD></TR>     <TR><TD>Ping</TD><TD>french toast</TD><TD>5.95</TD></TR>   </TBODY>   <TFOOT>     <TR><TH COLSPAN=2>Total</TH><TD>20.80</TD></TR>   </TFOOT> </TABLE> 

Here’s how that table renders:

NameFoodPrice
Starflowerstir fied tofu5.95
Mikovegetable rice soup4.95
Andyhummus3.95
Pingfrench toast5.95
Total20.80

Grouping By Column

To group by column use the <COLGROUP ...> tag and its SPAN attribute. <COLGROUP ...> takes a little getting used to because it doesn’t actually go around any table cells. It goes at the top of the table code where it sets rules about the table columns including which are grouped together. <COLGROUP SPAN="..."> to indicates how many columns are in each group. If you leave SPAN out then it is assumed the group has just one column. So, for example, the following code says that the first column is in a group by itself and the three after that are together in a group. Notice that <COLGROUP ...> requires an end tag. Borders will go only between the groups:

<TABLE BORDER=1 CELLPADDING=4 RULES=GROUPS  FRAME=BOX> <COLGROUP></COLGROUP> <COLGROUP SPAN=3></COLGROUP> 

Dropping those lines of html before the table contents produces this table:

WeekdayDateManagerQty
Monday09/11Kelsey639
Tuesday09/12Lindsey596
Wednesday09/13Randy1135
Thursday09/14Susan1002
Friday09/15Randy908
Saturday09/16Lindsey371
Sunday09/17Susan272

Values of the rules Attribute

Value NameNotes
all
cols
groups
none
rows

All Attributes of table Element

Attribute nameValuesNotes
framehsides
void
vsides
The frame attribute was used to define the visible borders of a table. It is now deprecated and should no longer be used.
height
hspace
rulesall
cols
groups
none
rows
summary
width
Claire is seasoned technical writer, editor, and HTML enthusiast. She writes for HTML.com and runs a content agency, Red Robot Media.