Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-13-2011, 04:45 PM   PM User | #1
Keleth
Senior Coder

 
Join Date: Jun 2008
Location: New Jersey
Posts: 2,354
Thanks: 45
Thanked 247 Times in 244 Posts
Keleth is on a distinguished road
Looking for a little help/advice on tables and css

Simply out, I'm wondering if its possible to control the top border of a td in a table. I'm working on a project where a list of users are displayed in a table, and when a user is flagged, I want to put a yellow border around it. So far, no luck, as I can't get the top border of any row except for the first row, to show in the right color. I've made the top and bottom borders of all tds black, so it spaces evenly, but I can't get the top border to do so... it seems that the bottom border of the row above overlays. Is there something I'm missing, via border-collapse or something similar? Or is this not a viable system with tables (I could easily rewrite this as a series of divs, but semantically, it is a able of information, so I'm trying to keep it is as such).
Keleth is offline   Reply With Quote
Old 02-13-2011, 05:04 PM   PM User | #2
Jimather
New Coder

 
Join Date: Jan 2011
Posts: 66
Thanks: 10
Thanked 5 Times in 5 Posts
Jimather is an unknown quantity at this point
Can you not give the tds an id or class name and target them that way ?

Have you tried giving them a little more padding/margin to try and space them to see what is going on?
Jimather is offline   Reply With Quote
Old 02-13-2011, 07:09 PM   PM User | #3
Keleth
Senior Coder

 
Join Date: Jun 2008
Location: New Jersey
Posts: 2,354
Thanks: 45
Thanked 247 Times in 244 Posts
Keleth is on a distinguished road
How I have it set up is the tr of row in question gets a class "flagged", and the css points to .flagged td. I have tried adding paddings and margins, but as far as I can tell, td's aren't affected by margins? Which makes sense on a table I guess.
Keleth is offline   Reply With Quote
Old 02-13-2011, 07:15 PM   PM User | #4
Jimather
New Coder

 
Join Date: Jan 2011
Posts: 66
Thanks: 10
Thanked 5 Times in 5 Posts
Jimather is an unknown quantity at this point
Ok, two more ideas.

Have you tried making the border absolutely excessive in an attempt to make it easier to see whether it is doubling up or overlapping ?

How about you put a <p> or <h5> tag inside each td, and target the borders on that ?
Jimather is offline   Reply With Quote
Old 02-13-2011, 08:21 PM   PM User | #5
Keleth
Senior Coder

 
Join Date: Jun 2008
Location: New Jersey
Posts: 2,354
Thanks: 45
Thanked 247 Times in 244 Posts
Keleth is on a distinguished road
Meh... if I'm gonna start using other techniques to actually get my border, I'd much rather just rebuild it into a set of divs.
Keleth is offline   Reply With Quote
Old 02-13-2011, 08:31 PM   PM User | #6
Jimather
New Coder

 
Join Date: Jan 2011
Posts: 66
Thanks: 10
Thanked 5 Times in 5 Posts
Jimather is an unknown quantity at this point
Ok, final thing though, Do you have rules="all" set in the table declaration ?

The border behaviour of the td's seems to be much more what you want without that set.
Jimather is offline   Reply With Quote
Old 02-13-2011, 08:38 PM   PM User | #7
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,600
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
Right, the borders seem to overlap so you don’t see the change on that one border. Table cells aren’t quite meant to do this so the best would be to really have a div in that cell and set the border color with it. Alternatively you could just change the background color of the cell.
__________________
Don’t click this link!
VIPStephan is online now   Reply With Quote
Old 02-14-2011, 03:55 AM   PM User | #8
Keleth
Senior Coder

 
Join Date: Jun 2008
Location: New Jersey
Posts: 2,354
Thanks: 45
Thanked 247 Times in 244 Posts
Keleth is on a distinguished road
Yah, the issue is background colors are meant to mark something else (3 different things actually), so I hoped I could go with borders... I guess its back to testing css, or going to divs... I hate breaking proper semantics

Last edited by Keleth; 02-14-2011 at 03:59 AM..
Keleth is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

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

Forum Jump


All times are GMT +1. The time now is 10:21 PM.


Advertisement
Log in to turn off these ads.