HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Different "standard" styles for Tables
Post new topic   Reply to topic    HTML Help Forum Index -> CSS
View previous topic :: View next topic  
Author Message
robinvdt



Joined: 21 Oct 2004
Posts: 5

PostPosted: Mon Jul 31, 2006 12:45 pm     Different "standard" styles for Tables Reply with quote

Hello,

I hope anyone can help me with the following problem:


I've created a default CSS document so all pages are formatted the same and are easy to adjust. But now I've run into a small problem.

I have given some formating rules for the < TABLE > tag and also made a seccond formatversion using .boldtable (read about that one somewhere)

But now I'm trying to create a third "default" table format. Does anyone have a suggestiont to make it work?


thanks

Robin
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8749
Location: Castle Pines North, CO USA

PostPosted: Mon Jul 31, 2006 12:54 pm     Reply with quote

I am pretty sure I understand what you mean, but giving us your source code would be beneficial - especially to see if you are using classes, ids, etc

_________________
Corey
Loud Commerce | Loud Worx | Merchant Account Blog
robinvdt



Joined: 21 Oct 2004
Posts: 5

PostPosted: Mon Jul 31, 2006 12:58 pm     Reply with quote

well the CSS currently looks like

Code:



<!--

body
   {
   font-family:verdana;
   font-size:10;
   color:black;
   background-color:white;

TABLE
   {
   font-family:verdana;
   font-size:10;
   color:black;
   background-color:white;
   }

.boldtable, .boldtable TD, .boldtable TH
   {
   font-family:verdana;
   font-size:10;
   color:#C10000;
   background-color:#FFFEB8;
   }

-->



(well and some more formatting for links etc.)


And now I'm looking for a way to define a third table with an other backgroundcolor etc.
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8749
Location: Castle Pines North, CO USA

PostPosted: Mon Jul 31, 2006 1:12 pm     Reply with quote

Well that is a start at least on the source code. I really wished you would have provided more.

Since styles cascade, using
Code:
table
   {
   font-family:verdana;
   font-size:10;
   color:black;
   background-color:white;
   }
will have all tables with a white background etc. And then instead of
Code:
.boldtable, .boldtable TD, .boldtable TH
   {
   font-family:verdana;
   font-size:10;
   color:#C10000;
   background-color:#FFFEB8;
   }
I would use something like
Code:
table.boldtable
   {
   font-size:10px;
   color:#C10000;
   background-color:#FFFEB8;
   width: 100%;
   }
so you can call that as
Code:
<table class="boldtable">
   <tr>
      <td></td>
   </tr>
</table>
and then something like
Code:
table.tabletwo
   {
   font-size:12px;
   color:#fff;
   background-color:#ccc;
   width: 100%;
   }
so that you can call it
Code:
<table class="tabletwo">
   <tr>
      <td></td>
   </tr>
</table>
So in essnece you would have something like
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<style type="text/css">
body
   {
   font-family:verdana;
   font-size:10;
   color:black;
   background-color:white;

table
   {
   font-family:verdana;
   font-size:10;
   color:black;
   background-color:white;
   }

table.boldtable
   {
   font-size:10;
   color:#C10000;
   background-color:#FFFEB8;
   width: 100%;
   }
table.tabletwo
   {
   font-size:12px;
   color:#fff;
   background-color:#ccc;
   width: 100%;
   }
</style>
</head>

<body>

<table class="boldtable">
   <tr>
      <td></td>
   </tr>
</table>

<table class="tabletwo">
   <tr>
      <td></td>
   </tr>
</table>

</body>

</html>
And this way you can add more as needed. Of course you can always rely on the default as well. No need to put the font family as long as they will be all verdana.

_________________
Corey
Loud Commerce | Loud Worx | Merchant Account Blog
robinvdt



Joined: 21 Oct 2004
Posts: 5

PostPosted: Tue Aug 01, 2006 1:16 am     Reply with quote

thanx! its working
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> CSS All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial