Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Web Design & Development > CSS

  • Print
  • + Share This
Like this article? We recommend

Like this article? We recommend

Tables for Spacing

Another common use for tables is to create accurate spacing. By using HEIGHT and WIDTH attributes in the TABLE and TR tags, it is possible to position text and graphics precisely on the page.

The HEIGHT and WIDTH attributes can be used in the TABLE tag to fix the minimum height and width of the entire table. Keep in mind that if you use any elements that are larger than these minimums, your table will expand accordingly.

<TABLE BORDER=0 CELLSPACING=0 BGCOLOR="#00CCCC"
 WIDTH=200 HEIGHT=200>
 <TR><TD ALIGN=CENTER> 200 X 200 Table
</TABLE>

In this table (see Figure 12), we have specified a width of 200 pixels and a height of 200 pixels. The table has only one cell, and that cell has the sentence 200 X 200 Table in it. To help us see the size of the table visually, we have given it a cyan background color. We set the BORDER and CELLSPACING attributes to zero so that the cell itself will fill all the space of the table.

Figure 12 A 200 X 200 table.

  • + Share This
  • 🔖 Save To Your Account