Previous Message
Next Message

css equivalent for this table code?

Sent by Dave Silvester on 25 May 2004 00:12

On Tuesday 25 May 2004 00:01, Francesco wrote:
> What is the CSS equivalent for this?
> <table border="1" cellpadding="5" cellspacing="0">
> <tr><td></td></tr>
> </table>

You are using the table for tabular data, not layout, right?  ;-)

"margin" is equivalent to cellspacing.
"padding" is equivalent to cellpadding.
"border-collapse" stops double borders appearing where you only want one.

In your case, something like this will do it:

table {
  border: 1px solid #000000;
  margin: 10px; /* Leave some space around the outside of the table */
  padding: 0; /* No padding inside the table */
  border-collapse: collapse; /* Collapse borders together */

td {
  border: 1px solid #000000;
  margin: 0; /* No gap between the cells */
  padding: 5px; /* Padding inside the cells */

Hope that helps!  :-)



Dave Silvester
Music Technology Junkie
Email: sly at mu hyphen sly dot co dot uk
css-discuss [EMAIL-REMOVED]]
List wiki/FAQ --
Supported by --
Previous Message
Next Message

Message thread:

Possibly related: