1. Computing & Technology

HTML Tables Attributes

Examples of How They Look

Attributes that are not part of the specification

Table Attribute - align (deprecated)

This table is right aligned
Text flows around it to the left

This is text that is flowing around the table.


Use CSS to Align Tables

This table is floated to the right
Text flows around it to the left

Return to HTML Tables Attributes article


Table Attribute - border

This is a border with a 1px border.

And here is the second example:

And this table has a border of 10.

Table Attribute - cellpadding

This table has a cellpadding of 20.
Cells will be separated by 20 pixels.

Return to HTML Tables Attributes article

Table Attribute - cellspacing

This table has a cellspacing of 20.
Cells will be separated by 20 pixels.

Table Attribute - frame

This table will have
only the left side framed.

And another example

This table has a frame on the bottom.

Return to HTML Advanced Tables Attributes article

Table Attribute - rules

This 4x4 table has the rows not columns
outlined with the rules attribute.
the more rows there are
the more rules there are

And here is an example with the columns highlighted:

This is a table where the
columns are highlighted
not the rows

Table Attribute - summary

column 1 row 1 column 2 row 1
column 1 row 2 column 2 row 2

Return to HTML Tables Attributes article

Table Attribute - width

This table is 80% of the width of the container it's in.

Non-Standard Table Attribute - bgcolor (deprecated)

This table has a grey background

Return to Non-Standard HTML Tables Attributes article

Use CSS to Set a Background Color

This table has a grey background

Non-Standard Table Attribute - height

This table is at least 30 ems high.

Non-Standard Table Attribute - hspace and vspace

This table has a vspace of 20 pixels and an hspace of 40 pixels.

Return to Non-Standard HTML Tables Attributes article

Non-Standard Table Attribute - nowrap

This is a column with a lot of content. But even if it is wider than the container the text should not wrap to the next line.

Non-Standard Table Attribute - valign

The text in this table should be aligned to the bottom of the table cells. Here is another cell.
Here is another cell. Here is another cell.

Return to Non-Standard HTML Tables Attributes article

Discuss in my forum

©2012 About.com. All rights reserved.

A part of The New York Times Company.