Wrox Programmer Forums
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
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

Old April 7th, 2005, 04:29 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

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:

<tr class="SomeClass">

  color: blue;

<tr id="SomeID">

  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.


Imar Spaanjaars
Everyone is unique, except for me.

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

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.