CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 18th, 2003, 03:39 AM
Benahimvp's Avatar
Benahimvp Benahimvp is offline
The Basketball Star
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2001
Location: H-Town
Posts: 550 Benahimvp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via AIM to Benahimvp Send a message via Yahoo to Benahimvp
Converting HTML formatting to CSS

This problem has been bugging me for quite some time now and each time I come across it, I end up just going back to the HTML method because CSS won't display it the way I want to.

Here's my HTML:
<table border="3" cellspacing="0" cellpadding="3" bgcolor="#dddddd" bordercolor="#00008b">

And that displays a gray table with a dark blue border of 3 pixels and the rules (lines inside the table) are also dakr blue and 3 pixels. The cells are padded 3 pixels as well.

Now I try to convert this to CSS and as I said, it doesn't look exactly right. Here's what I've got:

table { background-color: #dddddd; border: 3px solid #00008b; padding: 3px }

With this method I do get the flat dark blue border (not 3D) that I want, but that's about it. The rule lines go away and then there's space between the cells and it just looks bad.

Can anybody help me out?
__________________
-Ben Ilegbodu
(Around the Bend Web Designs)

Reply With Quote
  #2  
Old July 18th, 2003, 10:37 AM
magma's Avatar
magma magma is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Italy, EU
Posts: 517 magma User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 45 m 8 sec
Reputation Power: 6
You haven't considered that you need to set also the cells' properties... When you set a border of 3px for the table and don't specify the one of the cells, it is automatically set to 1px. So, if you want to have the same result with CSS, you've to define ALL the borders: 4 (3+1) for the table and 2 (1+1) for the cells and then set to COLLAPSE the border-collapse property to simulate the HTML property CELLSPACING="0"
Code:
table {
	background-color: #dddddd;
	border: 4px solid #00008b;
	border-collapse: collapse;
}
td {
	border: 2px solid #00008b;
	padding: 3px;
}

Hope it helps!
__________________
Cheers, Dave

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Converting HTML formatting to CSS


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway