HighDots Forums  

possible to draw a one pixel line around every cell in a table

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss possible to draw a one pixel line around every cell in a table in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Rolf Brauser
 
Posts: n/a

Default possible to draw a one pixel line around every cell in a table - 09-15-2004 , 03:22 AM






Hello,

is it possible to draw a one pixel line around every cell in a table?
with "border: 1px solid; " just the outer tableborder ist concerned ?

thanks for any help
rolf



Reply With Quote
  #2  
Old   
Andrew Thompson
 
Posts: n/a

Default Re: possible to draw a one pixel line around every cell in a table - 09-15-2004 , 03:32 AM






On Wed, 15 Sep 2004 10:22:37 +0200, Rolf Brauser wrote:

Quote:
is it possible to draw a one pixel line around every cell in a table?
Sure.

Why do you not provide a complete example
of what your are doing though, as it makes
it a lot easier for people to help.
<http://www.spartanicus.utvinternet.ie/help_us_help_you.htm>

Quote:
with "border: 1px solid; " just the outer tableborder ist concerned ?
Try this
<head>
.....
<style type='text/css'>
td {
border: solid 1px red;
}
</style>
</head>
<body>
....

Quote:
thanks for any help
No worries.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology


Reply With Quote
  #3  
Old   
Paul
 
Posts: n/a

Default Re: possible to draw a one pixel line around every cell in a table - 09-15-2004 , 03:36 AM



Rolf Brauser wrote:
Quote:
Hello,

is it possible to draw a one pixel line around every cell in a table?
with "border: 1px solid; " just the outer tableborder ist concerned ?

thanks for any help
rolf


This works for me:


table {
border: 2px solid #000;
empty-cells: show;
border-collapse: collapse;
}

th, td {
border: 1px solid #000;
}


Reply With Quote
  #4  
Old   
Rolf Brauser
 
Posts: n/a

Default Re: possible to draw a one pixel line around every cell in a table - 09-16-2004 , 03:04 AM



Quote:
This works for me:


table {
border: 2px solid #000;
empty-cells: show;
border-collapse: collapse;
}

th, td {
border: 1px solid #000;
}
Thanks, thats nice, thats truly 1 pixel arround every cell.
But that also means that where cells are touching the 1pixel is added to its
neighbourcell and so the border is 2 pixels broad.
Im looking for a solution where the border never is broader than 1 pixel,
independent from its structure (colspan or not).




Reply With Quote
  #5  
Old   
Johannes Koch
 
Posts: n/a

Default Re: possible to draw a one pixel line around every cell in a table - 09-16-2004 , 03:09 AM



Rolf Brauser wrote:
Quote:
Im looking for a solution where the border never is broader than 1 pixel,
independent from its structure (colspan or not).
Then put a border to the table's top and left, and to the cells' right
and bottom.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)


Reply With Quote
  #6  
Old   
Paul
 
Posts: n/a

Default Re: possible to draw a one pixel line around every cell in a table - 09-16-2004 , 04:44 AM



Rolf Brauser wrote:

Quote:
This works for me:


table {
border: 2px solid #000;
empty-cells: show;
border-collapse: collapse;
}

th, td {
border: 1px solid #000;
}


Thanks, thats nice, thats truly 1 pixel arround every cell.
But that also means that where cells are touching the 1pixel is added to its
neighbourcell and so the border is 2 pixels broad.
Not on my browser it's not, although my eyesight is not good enough to
be 100% sure. {border-collapse: collapse} causes the two borders to
collapse into one. Of course, rounding could cause differences between
different browsers. Read the specification:

http://www.w3.org/TR/CSS21/tables.ht...apsing-borders

Quote:
Im looking for a solution where the border never is broader than 1 pixel,
independent from its structure (colspan or not).
I wouldn't know about colspan as I have never used it in this context.

Regards

Paul


Reply With Quote
  #7  
Old   
Mikko Rantalainen
 
Posts: n/a

Default Re: possible to draw a one pixel line around every cell in a table - 09-16-2004 , 08:46 AM



Rolf Brauser / 2004-09-16 11:04:
[> Paul wrote]
Quote:
This works for me:

table {
border: 2px solid #000;
empty-cells: show;
border-collapse: collapse;
}

th, td {
border: 1px solid #000;
}

Thanks, thats nice, thats truly 1 pixel arround every cell.
But that also means that where cells are touching the 1pixel is added to its
neighbourcell and so the border is 2 pixels broad.
Im looking for a solution where the border never is broader than 1 pixel,
independent from its structure (colspan or not).
Above rules does *exactly* that -- assuming that your user agent
(commonly known as "browser") isn't broken and supports CSS.

If "td { border: solid black 1px }" results to more than a single
line of pixels between the cells and UA/display combination is able
to draw single pixel lines at all, the the user agent incorrectly
behaves like table had rule "border-collapse: separate". Some old
releases of Mozilla/Netscape did this.

--
Mikko


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.