473,395 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

table gutter spacing in CSS

I have a table with 3 columns in 1 row. I want to increase the spacing
_between_ the columns (gutter) _without_ increasing the spacing between
those columns and the table itself. Is there a way to do that in CSS
without having to code in extra dummy columns in HTML to create gutters?

--
-----------------------------------------------------------------------------
| Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
| (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------
Apr 28 '06 #1
10 11009
28 Apr 2006 22:41:33 GMT from <ph**************@ipal.net>:
I have a table with 3 columns in 1 row. I want to increase the spacing
_between_ the columns (gutter) _without_ increasing the spacing between
those columns and the table itself. Is there a way to do that in CSS
without having to code in extra dummy columns in HTML to create gutters?


I'm sure there is, but I don't understand your question.

The columns are _part_of_ the table, no? Then what do you mean by
"spacing between those columns and the table" -- how can there be
space between a thing and part of itself?

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/200..._wont_help_you
Apr 29 '06 #2
Stan Brown <th************@fastmail.fm> wrote:
28 Apr 2006 22:41:33 GMT from <ph**************@ipal.net>:
I have a table with 3 columns in 1 row. I want to increase the spacing
_between_ the columns (gutter) _without_ increasing the spacing between
those columns and the table itself. Is there a way to do that in CSS
without having to code in extra dummy columns in HTML to create gutters?


I'm sure there is, but I don't understand your question.

The columns are _part_of_ the table, no? Then what do you mean by
"spacing between those columns and the table" -- how can there be
space between a thing and part of itself?


I would guess he means to increase the spacing between the borders of
cells of adjacent columns, but between the borders of the cells in the
outermost columns and the borders of the table.

Going across the row:
table border - border-spacing - cell - border-spacing - cell -
border-spacing - cell - border-spacing - table border

So the objective is to have different values for the outer two lots of
border-spacing than for the inner two.

As the border-spacing property is set for the whole table this isn't
easily done with CSS.

Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Apr 29 '06 #3
To further the education of mankind, Steve Pugh <st***@pugh.net>
vouchsafed:
The columns are _part_of_ the table, no? Then what do you mean by
"spacing between those columns and the table" -- how can there be
space between a thing and part of itself?


I would guess he means to increase the spacing between the borders of
cells of adjacent columns, but between the borders of the cells in the
outermost columns and the borders of the table.

Going across the row:
table border - border-spacing - cell - border-spacing - cell -
border-spacing - cell - border-spacing - table border

So the objective is to have different values for the outer two lots of
border-spacing than for the inner two.

As the border-spacing property is set for the whole table this isn't
easily done with CSS.


Without actually having tried it, I think it's just a matter of perspective
(-and table padding and table borders. Of course padding isn't spacing,
but...)

--
Neredbojias
Infinity has its limits.
Apr 29 '06 #4
On Sat, 29 Apr 2006 05:55:45 -0400 Stan Brown <th************@fastmail.fm> wrote:
| 28 Apr 2006 22:41:33 GMT from <ph**************@ipal.net>:
|> I have a table with 3 columns in 1 row. I want to increase the spacing
|> _between_ the columns (gutter) _without_ increasing the spacing between
|> those columns and the table itself. Is there a way to do that in CSS
|> without having to code in extra dummy columns in HTML to create gutters?
|
| I'm sure there is, but I don't understand your question.
|
| The columns are _part_of_ the table, no? Then what do you mean by
| "spacing between those columns and the table" -- how can there be
| space between a thing and part of itself?

The gutter is the space specifically between the cells, borrowed from the
newspaper typesetting term used for the space between columns, which is
what I'm using cells for in this case.

There certainly can be space between the cells. The cells AND the space
are part of the table.

--
-----------------------------------------------------------------------------
| Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
| (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------
Apr 29 '06 #5
On Sat, 29 Apr 2006 11:30:48 -0400 Neredbojias <http://www.neredbojias.com/fliam.php?cat=alt.html> wrote:
| To further the education of mankind, Steve Pugh <st***@pugh.net>
| vouchsafed:
|
|>>The columns are _part_of_ the table, no? Then what do you mean by
|>>"spacing between those columns and the table" -- how can there be
|>>space between a thing and part of itself?
|>
|> I would guess he means to increase the spacing between the borders of
|> cells of adjacent columns, but between the borders of the cells in the
|> outermost columns and the borders of the table.
|>
|> Going across the row:
|> table border - border-spacing - cell - border-spacing - cell -
|> border-spacing - cell - border-spacing - table border
|>
|> So the objective is to have different values for the outer two lots of
|> border-spacing than for the inner two.
|>
|> As the border-spacing property is set for the whole table this isn't
|> easily done with CSS.
|
| Without actually having tried it, I think it's just a matter of perspective
| (-and table padding and table borders. Of course padding isn't spacing,
| but...)

However, padding goes everywhere. I don't want to increase that. I just
want to increase that which is between cells of the same row ... between
the <td> elements within a <tr> of a <table>.

--
-----------------------------------------------------------------------------
| Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
| (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------
Apr 29 '06 #6
On Sat, 29 Apr 2006 13:06:13 +0100 Steve Pugh <st***@pugh.net> wrote:
| Stan Brown <th************@fastmail.fm> wrote:
|
|>28 Apr 2006 22:41:33 GMT from <ph**************@ipal.net>:
|>> I have a table with 3 columns in 1 row. I want to increase the spacing
|>> _between_ the columns (gutter) _without_ increasing the spacing between
|>> those columns and the table itself. Is there a way to do that in CSS
|>> without having to code in extra dummy columns in HTML to create gutters?
|>
|>I'm sure there is, but I don't understand your question.
|>
|>The columns are _part_of_ the table, no? Then what do you mean by
|>"spacing between those columns and the table" -- how can there be
|>space between a thing and part of itself?
|
| I would guess he means to increase the spacing between the borders of
| cells of adjacent columns, but between the borders of the cells in the
| outermost columns and the borders of the table.
|
| Going across the row:
| table border - border-spacing - cell - border-spacing - cell -
| border-spacing - cell - border-spacing - table border
|
| So the objective is to have different values for the outer two lots of
| border-spacing than for the inner two.
|
| As the border-spacing property is set for the whole table this isn't
| easily done with CSS.

I had been trying to do it with the marging setting and that was not having
any effect. However, I tried it with the padding setting and it seems to
be working now.

td { padding-left: 24px; }
td:first-child { padding-left: 0px; }

But I still need to find a way to sequeeze the extra space off the edges
of the table. HTML seems to force 2 pixels there unless I do cellspacing=0
in the HTML on the table element.

--
-----------------------------------------------------------------------------
| Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
| (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------
Apr 29 '06 #7
To further the education of mankind, ph**************@ipal.net
vouchsafed:
I had been trying to do it with the marging setting and that was not
having any effect. However, I tried it with the padding setting and
it seems to be working now.

td { padding-left: 24px; }
td:first-child { padding-left: 0px; }

But I still need to find a way to sequeeze the extra space off the
edges of the table. HTML seems to force 2 pixels there unless I do
cellspacing=0 in the HTML on the table element.


With what you have, try this (in styles section):

table {
border-collapse:separate;
border-spacing:0px;
}

Bear in mind it doesn't work with IE6 but neither does first-child.

--
Neredbojias
Infinity has its limits.
Apr 29 '06 #8
ph**************@ipal.net wrote:
On Sat, 29 Apr 2006 13:06:13 +0100 Steve Pugh <st***@pugh.net> wrote:
| Stan Brown <th************@fastmail.fm> wrote:
|
|>28 Apr 2006 22:41:33 GMT from <ph**************@ipal.net>:
|>> I have a table with 3 columns in 1 row. I want to increase the spacing
|>> _between_ the columns (gutter) _without_ increasing the spacing between
|>> those columns and the table itself. Is there a way to do that in CSS
|>> without having to code in extra dummy columns in HTML to create gutters?
|>
|>I'm sure there is, but I don't understand your question.
|>
|>The columns are _part_of_ the table, no? Then what do you mean by
|>"spacing between those columns and the table" -- how can there be
|>space between a thing and part of itself?
|
| I would guess he means to increase the spacing between the borders of
| cells of adjacent columns, but between the borders of the cells in the
| outermost columns and the borders of the table.
|
| Going across the row:
| table border - border-spacing - cell - border-spacing - cell -
| border-spacing - cell - border-spacing - table border
|
| So the objective is to have different values for the outer two lots of
| border-spacing than for the inner two.
|
| As the border-spacing property is set for the whole table this isn't
| easily done with CSS.

I had been trying to do it with the marging setting and that was not having
any effect.
Table cells don't have margins.
However, I tried it with the padding setting and it seems to
be working now.
Ah. I assumed that you had visible borders on your table cells and
wanted the space between the borders (i.e. the CSS border-spacing
property) to be variable. IF you have no borders then padding will
allow you to do everything you want.
td { padding-left: 24px; }
td:first-child { padding-left: 0px; }
You'll need to add a class to the first cell to cope with IE's
non-support of the :first-child pseudoclass.
But I still need to find a way to sequeeze the extra space off the edges
of the table. HTML seems to force 2 pixels there unless I do cellspacing=0
in the HTML on the table element.


That would be the browser's default cellpadding/border-spacing (the
two are largely analogous). Setting it to zero in CSS in IE is done by
setting border-collapse: collapse (yes even if you have no borders).
Setting it to non zero values in CSS in IE is trickier.

Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Apr 30 '06 #9
On Sun, 30 Apr 2006 11:08:12 +0100 Steve Pugh <st***@pugh.net> wrote:
| ph**************@ipal.net wrote:
|
|>On Sat, 29 Apr 2006 13:06:13 +0100 Steve Pugh <st***@pugh.net> wrote:
|>| Stan Brown <th************@fastmail.fm> wrote:
|>|
|>|>28 Apr 2006 22:41:33 GMT from <ph**************@ipal.net>:
|>|>> I have a table with 3 columns in 1 row. I want to increase the spacing
|>|>> _between_ the columns (gutter) _without_ increasing the spacing between
|>|>> those columns and the table itself. Is there a way to do that in CSS
|>|>> without having to code in extra dummy columns in HTML to create gutters?
|>|>
|>|>I'm sure there is, but I don't understand your question.
|>|>
|>|>The columns are _part_of_ the table, no? Then what do you mean by
|>|>"spacing between those columns and the table" -- how can there be
|>|>space between a thing and part of itself?
|>|
|>| I would guess he means to increase the spacing between the borders of
|>| cells of adjacent columns, but between the borders of the cells in the
|>| outermost columns and the borders of the table.
|>|
|>| Going across the row:
|>| table border - border-spacing - cell - border-spacing - cell -
|>| border-spacing - cell - border-spacing - table border
|>|
|>| So the objective is to have different values for the outer two lots of
|>| border-spacing than for the inner two.
|>|
|>| As the border-spacing property is set for the whole table this isn't
|>| easily done with CSS.
|>
|>I had been trying to do it with the marging setting and that was not having
|>any effect.
|
| Table cells don't have margins.

No, but it would have been a way to do it if they had.
|> However, I tried it with the padding setting and it seems to
|>be working now.
|
| Ah. I assumed that you had visible borders on your table cells and
| wanted the space between the borders (i.e. the CSS border-spacing
| property) to be variable. IF you have no borders then padding will
| allow you to do everything you want.
|
|>td { padding-left: 24px; }
|>td:first-child { padding-left: 0px; }
|
| You'll need to add a class to the first cell to cope with IE's
| non-support of the :first-child pseudoclass.

I'm not going to worry about IE. I'll include a "Get Firefox" Icon/link.
|>But I still need to find a way to sequeeze the extra space off the edges
|>of the table. HTML seems to force 2 pixels there unless I do cellspacing=0
|>in the HTML on the table element.
|
| That would be the browser's default cellpadding/border-spacing (the
| two are largely analogous). Setting it to zero in CSS in IE is done by
| setting border-collapse: collapse (yes even if you have no borders).
| Setting it to non zero values in CSS in IE is trickier.

And Firefox? Or are you just doing IE?

--
-----------------------------------------------------------------------------
| Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
| (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------
Apr 30 '06 #10
ph**************@ipal.net wrote:
On Sun, 30 Apr 2006 11:08:12 +0100 Steve Pugh <st***@pugh.net> wrote:
| ph**************@ipal.net wrote:
|
|>td { padding-left: 24px; }
|>td:first-child { padding-left: 0px; }
|
| You'll need to add a class to the first cell to cope with IE's
| non-support of the :first-child pseudoclass.

I'm not going to worry about IE. I'll include a "Get Firefox" Icon/link.
Or just let IE users have a slightly different presentation (not as
good in your eyes but as no one else is likely to see it in more than
one browser, probably no one else will notice or care). Get Browser X
buttons are generally a waste of space and effort.
|>But I still need to find a way to sequeeze the extra space off the edges
|>of the table. HTML seems to force 2 pixels there unless I do cellspacing=0
|>in the HTML on the table element.
|
| That would be the browser's default cellpadding/border-spacing (the
| two are largely analogous). Setting it to zero in CSS in IE is done by
| setting border-collapse: collapse (yes even if you have no borders).
| Setting it to non zero values in CSS in IE is trickier.

And Firefox? Or are you just doing IE?


FireFox, Opera, Safari, etc., etc. support border-spacing and hence
don't need extra mollycoddling.

In your case border-collapse: collapse will suffice for all browsers
as that automatically sets border-spacing to zero.

Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Apr 30 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: bjam | last post by:
Hi, I am trying to do the following, which is to have a single place to define my table paramaters such as cellpadding / cellspacing etc. Below is the code I am trying to achieve see the cell...
1
by: Justin French | last post by:
Hi all, I've been using CSS for typography for quite some time, but have not looked into it too deep at all in regards to layout. Now is as good a time as any eh? Whilst ultimately I'll...
12
by: Rick DeBay | last post by:
I'm trying to create a layout table, where the spacing between rows varies. I've tried using setting margin-top and border-top for the rows I wan't spaced down from the one above, and I've also...
19
by: CMAR | last post by:
I have the following markup. The problem is that the browser, e.g., IE6, inserts several lines of blank space between the <div> and the following table. Is there a way to minimize that vertical...
3
by: Selden McCabe | last post by:
Sometimes I want to put a table inside a cell of another table (say, to create 3 equal divisions, etc.). When I want the inner table's edges to correspond exactly with the edges of the cell, I set...
16
by: Barbara de Zoete | last post by:
Here's what I'm trying to do: Create a table with generic style property . Have a few table cells in the thead that 'have to' melt into eachother, so needing the style . Looking somthing...
1
by: MissMarie | last post by:
I've been playing around with DIV tables in myspace to better learn how to rewrite my own code for my business site without having to pay someone to design it. I've tried embedding a slideshow into...
7
by: Jan | last post by:
Hi: I was so sure this was easy that I left it for the last minute and now I'm stuck. I'm working on the student directory for my kids' school and since it will be printed on 3-hole punch...
5
by: Stepheno | last post by:
Hi, I am a recently converted Iseries (AS/400) RPG programmer trying to learn HTML/CSS/JavsScript all at the same time (not fun). My problem deals mostly with CSS. I will be reveiving a table,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.