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 10-03-2006, 10:36 PM   PM User | #1
jerry2
New Coder

 
Join Date: Jun 2005
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
jerry2 is an unknown quantity at this point
Table with first row bordered?

Hi there

COuld anybody advise me if this is possible. I would like to make a table that has first row bordered, but other rows not. I know it is possible using border in CSS and <th> and <tr> but the problem is then the first row is 2 pixels wider, because it has border and the others do not have border.

The only trick I find is to make border around other rows also same colour as background on the table, so the border is seen as a background on the missing 2 pixels (when using border 1px. But since I have tables with many different backrounds it makes it impractical.

Is there any easier way to do it using tables and CSS? And yes, I do need tables, as I use tabelar data :-)

Yours

Jernej
jerry2 is offline   Reply With Quote
Old 10-04-2006, 12:57 AM   PM User | #2
Erindesign
Regular Coder

 
Join Date: Apr 2006
Posts: 231
Thanks: 9
Thanked 1 Time in 1 Post
Erindesign is an unknown quantity at this point
use height???

I've never edited rows themselves, just cells. what I would do is make the tds in the first row so they fit your style.

say you have 10 cells in the first row:
1st td: border-left, border-top, border-bottom.
2nd-9th td: border-top, border-bottom.
10th td: border-right, border-top, border-bottom.

The rest of the cells, just set the height on them and make it 2 bigger than the rest.

Hard-coding, sure. works, sure.
Erindesign is offline   Reply With Quote
Old 10-04-2006, 01:56 AM   PM User | #3
Arbitrator
Senior Coder

 
Arbitrator's Avatar
 
Join Date: Mar 2006
Location: Splendora, Texas, United States of America
Posts: 2,887
Thanks: 5
Thanked 186 Times in 183 Posts
Arbitrator is on a distinguished road
border-color: transparent is an option though that doesn't work in Internet Explorer 6.

What you really need is probably the border-box model where the border is considered part of the width of the box. To access it you either need to use the proposed CSS 3 box-sizing: border-box declaration (Opera), a proprietary declaration like -moz-box-sizing: border-box (Mozilla (Firefox)), or quirks mode (Internet Explorer).
__________________
Please for the love of god stop making IE. You current "browser"s cause me to cry every day. —Phil *
Arbitrator is offline   Reply With Quote
Old 10-04-2006, 08:33 AM   PM User | #4
jerry2
New Coder

 
Join Date: Jun 2005
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
jerry2 is an unknown quantity at this point
Yes, that is what I would need, that the border is part of the box. Problem is I am not very advanced and don't know how to do this.

I though of another not very good option. I make 2 tables, one for the first row and one for the rest :-) The second width is 100%-2px :-)

Jernej
jerry2 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 11:36 PM.


Advertisement
Log in to turn off these ads.