cellspacing question

T

Tony Vella

I would like to leave 12px between cells in a table. If I enter
cellspacing="12" into each <table> (tedious) it works perfectly every time,
but when I try to enter cellspacing into my css there are two things:
one: I'm using TopStyle Lite 3.1 and against the "table" selector the
cellspacing option is not available, and
two: If I enter it by hand (cellspacing: 12px;) it does not work.

So, can anyone tell me how to enter cellspacing in a ccs, please? Thanks in
advance.
 
R

rf

Tony Vella said:
I would like to leave 12px between cells in a table. If I enter
cellspacing="12" into each <table> (tedious) it works perfectly every time,
but when I try to enter cellspacing into my css there are two things:
one: I'm using TopStyle Lite 3.1 and against the "table" selector the
cellspacing option is not available, and
two: If I enter it by hand (cellspacing: 12px;) it does not work.

So, can anyone tell me how to enter cellspacing in a ccs, please? Thanks in
advance.

table {border-spacing: 12px}

Doesn't work in IE though.

Cheers
Richard.
 
T

Tony Vella

rf said:
table {border-spacing: 12px}

Doesn't work in IE though.

Cheers
Richard.

Oh, well, entering cellspacing in every <table> is tedious but at least it
works. Thanks Richard.
 
M

Marc Nadeau

Le Lundi, 17 Nov 2003 01:19:21 +0000, Tony Vella a écrit :
I would like to leave 12px between cells in a table. If I enter
cellspacing="12" into each <table> (tedious) it works perfectly every time,
but when I try to enter cellspacing into my css there are two things:
one: I'm using TopStyle Lite 3.1 and against the "table" selector the
cellspacing option is not available, and
two: If I enter it by hand (cellspacing: 12px;) it does not work.

So, can anyone tell me how to enter cellspacing in a ccs, please? Thanks in
advance.

Use

td {
margin: 12px;
}

in your style sheet.

Find a better tool for style tasks. eg: any simple text editor.

Bonne chance
 
T

Tony Vella

Marc said:
Le Lundi, 17 Nov 2003 01:19:21 +0000, Tony Vella a écrit :


Use

td {
margin: 12px;
}

in your style sheet.

Find a better tool for style tasks. eg: any simple text editor.

Bonne chance

Je te remercie, mon ami!
 
J

Jukka K. Korpela

Marc Nadeau said:
td {
margin: 12px;
}

If it "works", the browser is in error, since by CSS specifications, margin
properties do not affect elements that are presented as table cells. This
is, rather nastily, not mentioned in the description of the margin property
and only en passant in the description of visual presentation of tables:

"Like other elements of the document language, internal table elements
generate rectangular boxes with content, padding, and borders. They do not
have margins, however."
http://www.w3.org/TR/REC-CSS2/tables.html#q7

The CSS 2.1 draft tries to clarify things here, see
http://www.w3.org/TR/CSS21/box.html#propdef-margin

The border-spacing property that rf mentioned is the correct CSS way, and
the practical way at present is to use the HTML attribute.

However, why would you use a spacing of 12 pixels? Sounds rather big, and
why use physical units? In fact, it sounds that you are not presenting
tabular data but doing some layout only. In that case, a completely
different CSS approach might be in order, even if you continue using tables
for layout. (Maybe spacing can do what you want. URL?)
 
D

David Dorward

Tony said:
I would like to leave 12px between cells in a table. If I enter
cellspacing="12" into each <table> (tedious) it works perfectly every
time, but when I try to enter cellspacing into my css there are two
things:
one: I'm using TopStyle Lite 3.1 and against the "table" selector the
cellspacing option is not available, and
two: If I enter it by hand (cellspacing: 12px;) it does not work.

This is becuase there is no "cellspacing" property in CSS.
So, can anyone tell me how to enter cellspacing in a ccs, please?

<http://www.w3.org/TR/CSS2/tables.html#propdef-border-spacing>
 
T

Tony Vella

Jukka said:
If it "works", the browser is in error, since by CSS specifications,
margin properties do not affect elements that are presented as table
cells. This is, rather nastily, not mentioned in the description of
the margin property and only en passant in the description of visual
presentation of tables:

"Like other elements of the document language, internal table elements
generate rectangular boxes with content, padding, and borders. They
do not have margins, however."
http://www.w3.org/TR/REC-CSS2/tables.html#q7

The CSS 2.1 draft tries to clarify things here, see
http://www.w3.org/TR/CSS21/box.html#propdef-margin

The border-spacing property that rf mentioned is the correct CSS way,
and the practical way at present is to use the HTML attribute.

However, why would you use a spacing of 12 pixels? Sounds rather big,
and why use physical units? In fact, it sounds that you are not
presenting tabular data but doing some layout only. In that case, a
completely different CSS approach might be in order, even if you
continue using tables for layout. (Maybe spacing can do what you
want. URL?)

I am preparing a virtual album of the Sudan Camel Postman stamps of
1898-1998. I have to enter information under each stamp, such as catalogue
number, type of watermark, date of issue, date of surcharge, etc. When the
stamps are wide I have no problem but when the stamps are small (narrow)
dates like January 25, 1922 and March 21, 1922 end up touching each other.
So, since I only want 4 stamps maximum in each row, I can afford to
experiment with cellspacing until there is a decent gap between the longest
texts under each stamps. I am looking for a way of avoiding having to enter
the cellspacing manually in each <table>. The bottom line, I guess, is that
I do not wish to spend so much time writing HTML or learning some new
write-up language that I no longer have time for stamp collecting.

<table border="0" cellspacing="12" summary="">
<tr>
<td><img src="29.jpg" border="0" width="87" height="103"
alt=""><br>29<br>February 4, 1922</td>
<td><img src="30.jpg" border="0" width="87" height="103"
alt=""><br>30<br>1922</td>
<td><img src="31.jpg" border="0" width="87" height="103"
alt=""><br>31<br>January 25, 1922</td>
<td><img src="32.jpg" border="0" width="87" height="103"
alt=""><br>32<br>March 21, 1922</td>
</tr>
</table>

In my Mexican "Exporta" virtual album at
http://members.rogers.com/tony.vella/mexico/index.html I will not have to
face the same problem when I enter the dates of issue because all exportas
are rather wide stamps. Thanks to all for all help.
 
R

rf

I am preparing a virtual album of the Sudan Camel Postman stamps of
1898-1998. I have to enter information under each stamp, such as catalogue
number, type of watermark, date of issue, date of surcharge, etc. When the
stamps are wide I have no problem but when the stamps are small (narrow)
dates like January 25, 1922 and March 21, 1922 end up touching each other.
So, since I only want 4 stamps maximum in each row, I can afford to
experiment with cellspacing until there is a decent gap between the longest
texts under each stamps. I am looking for a way of avoiding having to enter
the cellspacing manually in each <table>. The bottom line, I guess, is that
I do not wish to spend so much time writing HTML or learning some new
write-up language that I no longer have time for stamp collecting.

Hmmm. Matters change when the real problem is stated, not, as Jukka often
says: difficulties with a perceived solution.

td {padding: 12px}

which *does* work with IE.

Cheers
Richard.
 
T

Tony Vella

rf said:
Hmmm. Matters change when the real problem is stated, not, as Jukka
often says: difficulties with a perceived solution.

td {padding: 12px}

which *does* work with IE.

Cheers
Richard.

I've tried it. It does exactly what I want it to do. Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top