HighDots Forums  

Removing one margin/edge from one cell in a table

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


Discuss Removing one margin/edge from one cell in a table in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Steve Swift
 
Posts: n/a

Default Removing one margin/edge from one cell in a table - 01-23-2008 , 03:05 AM






The table in question is at http://www.swiftys.org.uk/calendar

The HTML is pre-Cambrian, almost certainly invalid, generated by one of
the first CGI scripts that I ever wrote, about 15 years ago (initially).
The strange fact is that it works in all popular browsers. It even works
in "Off by One".

The edge in question is the boundary between the tall/narrow grey cell
on the right and the large grey cell at the "south east" corner of the
table. I'd like it to go away, and I suspect this is a job for CSS.

This raises an interesting question (I find it interesting):

Which cell "owns" that boundary? Or is it somehow shared between the
adjacent cells?

Please, I'm not interested in criticism of the HTML or layout of the
page any more than I'd be interested in criticism of the brand of oil I
use on the wooden handle of my hammer. They are both tools, and they
both work for me. That border is driving me nuts though, now I've
noticed it, so if you can suggest how to make it go away, or even just
reduce it a bit, then I'm all ears.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk

Reply With Quote
  #2  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: Removing one margin/edge from one cell in a table - 01-23-2008 , 11:37 AM






Steve Swift wrote:
Quote:
The table in question is at http://www.swiftys.org.uk/calendar

The HTML is pre-Cambrian, almost certainly invalid, generated by one of
the first CGI scripts that I ever wrote, about 15 years ago (initially).
The strange fact is that it works in all popular browsers. It even works
in "Off by One".

The edge in question is the boundary between the tall/narrow grey cell
on the right and the large grey cell at the "south east" corner of the
table. I'd like it to go away, and I suspect this is a job for CSS.

This raises an interesting question (I find it interesting):

Which cell "owns" that boundary? Or is it somehow shared between the
adjacent cells?

Please, I'm not interested in criticism of the HTML or layout of the
page any more than I'd be interested in criticism of the brand of oil I
use on the wooden handle of my hammer. They are both tools, and they
both work for me. That border is driving me nuts though, now I've
noticed it, so if you can suggest how to make it go away, or even just
reduce it a bit, then I'm all ears.

Ugh! Well aside of crap like tables with span if you are talking about
the empty purple-grey column on the far right, then your need to remove:

<TD ROWSPAN=13 BGCOLOR=#8080B0><BR></TD>

*and* adjust all those other rows with colspan...

But in my option it would be easier to just redo the script. Dump all
the old crap, use CSS to lean out the markup. If in Perl with the CGI.pm
this would make the coding real easy and then style in your stylesheet.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
  #3  
Old   
Steve Swift
 
Posts: n/a

Default Re: Removing one margin/edge from one cell in a table - 01-23-2008 , 11:46 PM



Jonathan N. Little wrote:
Quote:
Ugh! Well aside of crap like tables with span if you are talking about
the empty purple-grey column on the far right, then your need to remove:

TD ROWSPAN=13 BGCOLOR=#8080B0><BR></TD
You misread me. I want the border to go away, not the cell. The cell is
there because I'm emulating an actual wall calendar. The only
significant difference between the wall calendar and my page is that border.

Quote:
But in my option it would be easier to just redo the script. Dump all
the old crap, use CSS to lean out the markup.
Yes, I could reduce the markup with CSS, but the script predates CSS, it
works (other than that border) and I'm not minded to put that much
effort in. For me, computers are about reducing the amount of effort I
have to expend, not increasing it.
I wrote the entire page (i.e script) in less than 8 hours. I'd be very
interested to see if anyone could achieve the same effect, even a static
HTML page for one year, in less than 8 hours using CSS rather than
tables. It would have to work across all popular browsers, of course.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk


Reply With Quote
  #4  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: Removing one margin/edge from one cell in a table - 01-24-2008 , 12:13 AM



Steve Swift wrote:
Quote:
Jonathan N. Little wrote:
Ugh! Well aside of crap like tables with span if you are talking about
the empty purple-grey column on the far right, then your need to remove:

TD ROWSPAN=13 BGCOLOR=#8080B0><BR></TD

You misread me. I want the border to go away, not the cell. The cell is
there because I'm emulating an actual wall calendar. The only
significant difference between the wall calendar and my page is that
border.

But in my option it would be easier to just redo the script. Dump all
the old crap, use CSS to lean out the markup.

Yes, I could reduce the markup with CSS, but the script predates CSS, it
works (other than that border) and I'm not minded to put that much
effort in. For me, computers are about reducing the amount of effort I
have to expend, not increasing it.
I wrote the entire page (i.e script) in less than 8 hours. I'd be very
interested to see if anyone could achieve the same effect, even a static
HTML page for one year, in less than 8 hours using CSS rather than
tables. It would have to work across all popular browsers, of course.

Sorry, but still need to do it with CSS, the only way to have such
granularity in styling. And you will need a class so my first suggestion
still stands, a recode is in order. BTW you would *still* use a table.
It is not CSS *or* table, it's CSS or all that attribute crap, BGCOLOR,
VALIGN, BORDER ...

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
  #5  
Old   
rf
 
Posts: n/a

Default Re: Removing one margin/edge from one cell in a table - 01-24-2008 , 01:20 AM




"Steve Swift" <Steve.J.Swift (AT) gmail (DOT) com> wrote

Quote:
Jonathan N. Little wrote:
Ugh! Well aside of crap like tables with span if you are talking about
the empty purple-grey column on the far right, then your need to remove:

TD ROWSPAN=13 BGCOLOR=#8080B0><BR></TD

You misread me. I want the border to go away, not the cell. The cell is
there because I'm emulating an actual wall calendar. The only significant
difference between the wall calendar and my page is that border.

But in my option it would be easier to just redo the script. Dump all the
old crap, use CSS to lean out the markup.

Yes, I could reduce the markup with CSS, but the script predates CSS, it
works (other than that border) and I'm not minded to put that much effort
in. For me, computers are about reducing the amount of effort I have to
expend, not increasing it.
I wrote the entire page (i.e script) in less than 8 hours. I'd be very
interested to see if anyone could achieve the same effect, even a static
HTML page for one year, in less than 8 hours using CSS rather than tables.
It would have to work across all popular browsers, of course.
This is tablular data so a table is appropriate. However what Jonathan is
getting at is that without CSS you are restricted to using table borders
that you can specify using HTML. That is, a border for every cell.

If you want a particular cell to not have a border then you must switch off
the HTML borders (border='0') and switch on CSS borders (td {border=solid
1px grey}). In your case it looks like top and left borders are dark grey
and the other two are light grey. Style them accordingly.

Now, you can style an individual cell to have, for example,
style="border-bottom: none;". You will find that the offending line is
actually the bottom border of the cell with rowspan 13 plus part of the top
border of the south east cell. You might have to back off the colspan of
that cell and introduce another cell, the "real" south" east one, and style
that cells borders accordingly.

You should only have to spend ten minutes max to sort this one out.

--
Richard.




Reply With Quote
  #6  
Old   
Steve Swift
 
Posts: n/a

Default Re: Removing one margin/edge from one cell in a table - 01-24-2008 , 12:38 PM



rf wrote:
Quote:
If you want a particular cell to not have a border then you must switch off
the HTML borders (border='0') and switch on CSS borders (td {border=solid
1px grey}). In your case it looks like top and left borders are dark grey
and the other two are light grey. Style them accordingly.
Aha! A light comes on. I've seen borders defined as "ridge" and things
like indented and outdented in HTML. What is actually happening is that
the borders are coloured as you say, but inside the table, the cells are
actually separated by a pair of different-coloured borders. The tricky
part is maintaining the ridge effect on the exterior borders of the
table, where there would be only a single (i.e. half width) border.

I suspect this is the point where I gave up trying to emulate tables
using DIV's - I never managed to make the exterior borders look the same
as the interior ones.

I suspect that the simplest solution is to do nothing. After a while,
I'll stop noticing that extra tiny piece of border, in the same way that
I don't see the paint peeling off my front door. :-)

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk


Reply With Quote
  #7  
Old   
rf
 
Posts: n/a

Default Re: Removing one margin/edge from one cell in a table - 01-24-2008 , 07:36 PM




"Steve Swift" <Steve.J.Swift (AT) gmail (DOT) com> wrote

Quote:
rf wrote:
If you want a particular cell to not have a border then you must switch
off the HTML borders (border='0') and switch on CSS borders (td
{border=solid 1px grey}). In your case it looks like top and left borders
are dark grey and the other two are light grey. Style them accordingly.

Aha! A light comes on. I've seen borders defined as "ridge" and things
like indented and outdented in HTML. What is actually happening is that
the borders are coloured as you say, but inside the table, the cells are
actually separated by a pair of different-coloured borders. The tricky
part is maintaining the ridge effect on the exterior borders of the table,
where there would be only a single (i.e. half width) border.
You would utilise the tables border, which sits around the cell borders.

Quote:
I suspect this is the point where I gave up trying to emulate tables using
DIV's -
Don't. If it's a table then use a table. That is what they are for.

Quote:
I never managed to make the exterior borders look the same as the interior
ones.
Table border.

Quote:
I suspect that the simplest solution is to do nothing. After a while, I'll
stop noticing that extra tiny piece of border, in the same way that I
don't see the paint peeling off my front door. :-)
<tinkers>
http://barefile.com.au/swift/calendar.htm
Messy but it works.
Look for the comments on the bits I changed, at the beginning and right at
the end.

--
Richard.




Reply With Quote
  #8  
Old   
Steve Swift
 
Posts: n/a

Default Re: Removing one margin/edge from one cell in a table - 01-25-2008 , 04:16 AM



rf wrote:
Quote:
tinkers
http://barefile.com.au/swift/calendar.htm
Messy but it works.
Look for the comments on the bits I changed, at the beginning and right at
the end.
Thank you! It will be a while before I get a chance to work out what you
did, and how it works. Than I can add it to my CGI script.

Incidentally, the table that I tried to convert to <DIV>s was not truly
a table. It was a box into which I wanted to put 29 short facts about
something. Each fact would fit in a table cell without wrapping. The
page was a sequence of these "tables".

I've ended up using a table with 100 columns, and using "COLSPAN=X" in
each cell to achieve the necessary weight/width for each individual
cell. The effect is like a brick wall built from random length bricks.
It's not a table, as such.
It would be easier to add extra facts, as happens occasionally, if I
were dealing with the relative weights of each cell in its row. That
way, it wouldn't matter if they didn't add up to 100.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk


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.