Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > CSS > CSS Cascading Style Sheets
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 6th, 2005, 09:25 PM
Authorized User
 
Join Date: Sep 2003
Location: Melbourne, Victoria, Australia.
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dumb Question

I have lots of tags redefined in CSS but redefining the table tag is getting me nowhere

I use two types of alignment in two different tables

At the moment I have two style sheets one for each table,
I also tried a second style sheet just redefining the Table elements
but then i run into trouble when I need to switch back

this is my basic definition for my table

th {background-color: #000080;
    border-color: #28B3B1;
    color: #FFFFFF;
    font: bold 13px verdana,Arial,Helvetica,Geneva,sans-serif;
    text-align: right;
}

table, tbody, tr, td {
    background-color: #EFF7FA;
    border-color: #000080;
    color: #000000;
    font: normal 12px verdana,Arial,Helvetica,Geneva,sans-serif;
    text-align: left;
}

and this is what I am trying to do and cannot get right


.th2 {
    background-color: #000080;
    border-color: #28B3B1;
    color: #FFFFFF;
    font: bold 13px verdana,Arial,Helvetica,Geneva,sans-serif;
    text-align: center;
}

.th3 {
    background-color: #000080;
    border-color: #28B3B1;
    color: #FFFFFF;
    font: bold 13px verdana,Arial,Helvetica,Geneva,sans-serif;
    text-align: left;
}

I am calling it in htm with <table2> blah </table>

As I said a stupid question

Topshed
Reply With Quote
  #2 (permalink)  
Old April 7th, 2005, 04:29 PM
Imar's Avatar
Wrox Author
Points: 66,557, Level: 100
Points: 66,557, Level: 100 Points: 66,557, Level: 100 Points: 66,557, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,119
Thanks: 65
Thanked 1,381 Times in 1,361 Posts
Default

Although you can override the appearance of tags, you can't actually define new tags. Although CSS might now how to handle tr2, the browser doesn't and doesn't know it's supposed to render it as a tr.

Try to set an id or class, like this:

Class
<tr class="SomeClass">

CSS:
.SomeClass
{
  color: blue;
}


ID:
<tr id="SomeID">

CSS:
#ID
{
  color: blue;
}

IDs must be unique within a page, while classes can be used multiple times.

Check out Richard York's excellent Beginning CSS if you want to know all about CSS.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
Reply


Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
dumb question dazmiller SQL Language 2 September 29th, 2005 09:10 AM
Dumb date to record question topshed Classic ASP Databases 2 June 3rd, 2005 01:42 PM
dumb version question on ASP 1.0/1.1/2.0 badgolfer ASP.NET 1.0 and 1.1 Basics 1 October 5th, 2004 07:10 AM



All times are GMT -4. The time now is 01:44 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.