[Home]Border for table cells

HomePage | RecentChanges | Preferences | Newbie Help

CSS FAQs

Geoff Ball says --

If you want the borders of each cell to show, you must specify a style for td. If you want the borders of cells next to each other to merge into one, specify border-collapse:collapse.

For example, if you want each cell to have a border as specified above:

 td {
  border: thin solid #000;
  color: #000;
  padding: 10%;
  margin: 0;
  border-collapse: collapse;
 }

As a side note, anything with a value of 0 does not (and I believe should not) need a unit, since 0% = 0px = 0pt = 0 anything.


Comments --

Geoff Ball says --

A background-color should also be specified above (when a color is indicated, a corresponding background color should be as well).

For example:

 td {
  border: thin solid #000;
  color: #000;
  background-color:#fff;
  padding: 10%;
  margin: 0;
  border-collapse: collapse;
 }

HomePage | RecentChanges | Preferences | Newbie Help
This page is read-only | View other revisions
Last edited June 28, 2003 2:29 am (diff)
Search:

This FAQ is happily hosted by Betadome Digital Media