Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / January 2008



Tip: Looking for answers? Try searching our database.

Removing one margin/edge from one cell in a table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve Swift - 23 Jan 2008 09:05 GMT
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.

Signature

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

Jonathan N. Little - 23 Jan 2008 17:37 GMT
> The table in question is at http://www.swiftys.org.uk/calendar
>
[quoted text clipped - 18 lines]
> 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.

Signature

Take care,

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

Steve Swift - 24 Jan 2008 05:46 GMT
> 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.

Signature

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

Jonathan N. Little - 24 Jan 2008 06:13 GMT
>> 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:
[quoted text clipped - 17 lines]
> 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 ...

Signature

Take care,

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

rf - 24 Jan 2008 07:20 GMT
>> 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:
[quoted text clipped - 16 lines]
> 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.

Signature

Richard.

Steve Swift - 24 Jan 2008 18:38 GMT
> 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. :-)

Signature

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

rf - 25 Jan 2008 01:36 GMT
>> 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
[quoted text clipped - 7 lines]
> 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.

> 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.

> I never managed to make the exterior borders look the same as the interior
> ones.

Table border.

> 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.

Signature

Richard.

Steve Swift - 25 Jan 2008 10:16 GMT
> <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.

Signature

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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.