Link to home
Start Free TrialLog in
Avatar of edvinson
edvinsonFlag for United States of America

asked on

Targeting CSS for certain Table, newbie help

How can I make this CSS apply to only a table with the ID of "MYTABLE" ?

Thanks!

table,td
{
      border               : 1px solid #CCC;
      border-collapse      : collapse;
  font                 : small/1.5 "Tahoma", "Bitstream Vera Sans", Verdana, Helvetica, sans-serif;
}
table
{
      border                :none;
      border                :1px solid #CCC;
}
thead th,
tbody th
{
      background            : #FFF url(th_bck.gif) repeat-x;
  color                 : #666;  
      padding               : 5px 10px;
  border-left           : 1px solid #CCC;
}
tbody th
{
  background            : #fafafb;
  border-top            : 1px solid #CCC;
  text-align            : left;
  font-weight           : normal;
}
tbody tr td
{
      padding               : 5px 10px;
  color                 : #666;
}
tbody tr:hover
{
  background            : #FFF url(tr_bck.gif) repeat;
}

tbody tr:hover td
{
  color                 : #454545;
}
tfoot td,
tfoot th
{
  border-left           : none;
  border-top            : 1px solid #CCC;
      padding               : 4px;
  background            : #FFF url(foot_bck.gif) repeat;
  color                 : #666;
}
caption
{
      text-align            : left;
      font-size             : 120%;
      padding               : 10px 0;
      color                 : #666;
}
table a:link
{
      color                 : #666;
}
table a:visited
{
      color                 : #666;
}
table a:hover
{
      color                 : #003366;
      text-decoration       : none;
}
table a:active
{
      color                 : #003366;
}
Avatar of Mark Steggles
Mark Steggles
Flag of United States of America image

Greetings edvinson,

To style a table with id="MYTABLe" only

You need to use this format

#MYTABLE {style}
#MYTABLE td {style}
#MYTABLE a:hover {style} etc etc
Regards
Avatar of edvinson

ASKER

So in therory, if I add #mytable in front of all those style tags, it will work?
appears I can't spell theory.  :(
ASKER CERTIFIED SOLUTION
Avatar of Mark Steggles
Mark Steggles
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial