Reply
CSS: all td's of a table behave acording to the table
Old 05-03-2005, 11:55 AM CSS: all td's of a table behave acording to the table
Recrehal's Avatar
Experienced Talker

Posts: 39
Location: Aachen, Germany
If I want borders around all my <td>'s, but want a class called "navigation" to not have a border, is there a way to assign the class only to the surounding table? CSS doesn't make sense if I have to assign each and every td to the class navigation so I know there is a way.

In other words, what is to do to use

HTML Code:
<table class="navigation">
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
</table>
instead of

HTML Code:
<table>
<tr>
<td class="navigation">a</td>
<td class="navigation">b</td>
<td class="navigation">c</td>
</tr>
</table>
[CSS]
td
{
border: 1px solid #000000;
}

.navigation
{
border: 0px;
}
[/CSS]
Recrehal is offline
Reply With Quote
View Public Profile Visit Recrehal's homepage!
 
When You Register, These Ads Go Away!
Old 05-04-2005, 02:38 PM
Skorch's Avatar
Super Talker

Posts: 115
Location: California
Your css file should look like this Use shorter class names easier to add into html pages!(add your own font info)

table.navigation {border: o}
table {border: 10px}

then to insert into your html type

table class="navigation" <tr>...and ontinue with your table as normal

This now means you have two table tags one has a border (table) and the other doesn't (table class="navigation")
Skorch is offline
Reply With Quote
View Public Profile Visit Skorch's homepage!
 
Old 05-05-2005, 07:59 AM
Recrehal's Avatar
Experienced Talker

Posts: 39
Location: Aachen, Germany
I don't want a border around the table, but around the <td>'s so that doesn't really help. Furthermore a classname should always represent the meaning so there is no need to shorten it. As for the insertion: I'm using PHP anyway

So isn't there a way to get this done? Probalby with *>.navigation or something. I'm sure there is a way to asign the same border (which shall be none) to the table aswell as to the td's inside of it.
Recrehal is offline
Reply With Quote
View Public Profile Visit Recrehal's homepage!
 
Old 05-05-2005, 11:49 AM
brokensoul2271's Avatar
- - - - - - - - -

Posts: 750
Location: Lancashire, UK
i'm really not sure about this and dont have time to try but wouldnt it work if you did
HTML Code:
<table id=navigation>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
</table>
and in your css,
Code:
#navigation td {CSS RULE}
like i said really unsure about it and still dont know alot about CSS so sorry if its wrong..
__________________
Yes, indeed...
WebDevWorld.net | StrangeDarkness.com | MyNEWBlog
brokensoul2271 is offline
Reply With Quote
View Public Profile Visit brokensoul2271's homepage!
 
Reply     « Reply to CSS: all td's of a table behave acording to the table
 

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.34052 seconds with 12 queries