CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

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 Rating: Thread Rating: 2 votes, 2.00 average. Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 9th, 2003, 04:22 PM
zaphoyd zaphoyd is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 2 zaphoyd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to zaphoyd
Question controling CSS table borders efficently

My site layout generally uses tables with no borders at all. So in my global css file I have:

Code:
TABLE
{
	border-collapse: collapse;
	empty-cells: show;
	border: 0px;
	padding: 0px;
	margin: 0px;
	background-color: #$background;
}

TD
{
	padding: 4px;
	background-color: #$background;
	color: #$backtext;
	margin: 0;
}


occasionally I would like to make a table that shows all the borders. (ie a normal html table with all grid lines)

Is there any way in css to override the default table and make a table with borders when the default table has none.

I have found one way, but it is ridiculously inefficient, css is so slick in everything else, is there a way to do what I need without resorting to the following:

Code:

TABLE.border
{
	border-collapse: collapse;
	border-width: 2px;
	border: outset 2px;
}

TD.border
{
	padding: 4px;
	background-color: #$background;
	color: #$backtext;
	margin: 0;
	border: inset 1pt;
}


Then labeling EVERY SINGLE DATA CELL class=border.

######## Question 2 ########
Also is there an easy way of only showing internal borders with css. You could do it with HTML 'rules', but support for them seems to have died after css came. What I want is a balence sheet table that shows the vertical and horizontal lines between datacells, but NOT the borders of the table. I just want the cells on the edges to have one open side.

Reply With Quote
  #2  
Old July 9th, 2003, 04:58 PM
kk5st's Avatar
kk5st kk5st is offline
Thanks Johnny Hart (BC) R.I.P.
Dev Shed God (5000 - 5499 posts)
 
Join Date: May 2003
Location: Dallas
Posts: 5,268 kk5st User rank is General 15th Grade (Above 100000 Reputation Level)kk5st User rank is General 15th Grade (Above 100000 Reputation Level)kk5st User rank is General 15th Grade (Above 100000 Reputation Level)kk5st User rank is General 15th Grade (Above 100000 Reputation Level)kk5st User rank is General 15th Grade (Above 100000 Reputation Level)kk5st User rank is General 15th Grade (Above 100000 Reputation Level)kk5st User rank is General 15th Grade (Above 100000 Reputation Level)kk5st User rank is General 15th Grade (Above 100000 Reputation Level)kk5st User rank is General 15th Grade (Above 100000 Reputation Level)kk5st User rank is General 15th Grade (Above 100000 Reputation Level)kk5st User rank is General 15th Grade (Above 100000 Reputation Level)kk5st User rank is General 15th Grade (Above 100000 Reputation Level)kk5st User rank is General 15th Grade (Above 100000 Reputation Level)kk5st User rank is General 15th Grade (Above 100000 Reputation Level)kk5st User rank is General 15th Grade (Above 100000 Reputation Level)kk5st User rank is General 15th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 4 Days 10 h 31 m 27 sec
Reputation Power: 1955
Try this;
Code:
TABLE.border
{
	border-collapse: collapse;
	border-width: 2px;
	border: outset 2px;
}

TABLE.border  TD
{
	padding: 4px;
	background-color: #$background;
	color: #$backtext;
	margin: 0;
	border: inset 1pt;
}


cheers,

gary
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing.

My html and css workshop, demos and tutorials.
Ask a better question, get a better answer.

Reply With Quote
  #3  
Old July 9th, 2003, 05:09 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,817 jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 4 Days 7 h 14 m 56 sec
Reputation Power: 1098
Answer 2:

Dont' sepcify a border for your TABLE, or rather specify to use none, then specify the left/right borders for the cells:
Code:
border-left: 1px solid black;
border-right: 1px solid black;

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > controling CSS table borders efficently

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap