Link to home
Start Free TrialLog in
Avatar of jagguy
jagguyFlag for Australia

asked on

table css override

Hi,

How do I overrride the table css  as below which work for every table on the website? I have another table which
I want to display another way

   table,  th ,td{
    border-bottom: 1px solid lightblue;
     border-bottom: 1px solid blue;
      font-size: .93em; /* 14px/16=0.875em */
      font-family: "Arial", Times, serif;
    font-weight: bold;
    //   color: #666666;
    // background-color: lightgreen;
   //color:red;
}


tr {
     
    	vertical-align: bottom;
}


th {
    background-color: lightblue;
    
    color: black;
}
.td1{
    
    color: #3399ff
}

Open in new window

Avatar of Member_2_6317024
Member_2_6317024
Flag of United States of America image

Give your tables a class name according to the stylings.
Say style1 and style2.

table.style1 (continue styles as above)
Do the same for style 2.
In the table tags be sure to add class="style 1or 2"☺
Avatar of jagguy

ASKER

This is not working.
I want to have the same table,tr css and only for the odd table add a class so I can override the default table css.

For example i cant remove the blue border from the style2/3 table as it always picks up the tr css


   table,  th ,td{
    border-bottom: 1px solid blue;
      font-size: .93em; /* 14px/16=0.875em */
      font-family: "Arial", Times, serif;
    font-weight: bold;
   
}

style2.table,  style2.th ,style2.td{
     border: none;
      font-size: .93em; /* 14px/16=0.875em */
      font-family: "Arial", Times, serif;
 
}

style3.tr {
      border-bottom: 1px solid red;
      font-size: .93em; /* 14px/16=0.875em */
      font-family: "Arial", Times, serif;

}

   echo '<table class="style2" >';
            echo '<tr class="style3">';
              
               echo '<td>';
         

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Member_2_6317024
Member_2_6317024
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
Avatar of jagguy

ASKER

sorry your explanation just isnt working.

For example I just dont get any css now when I set the table to.
It just doesnt pick anything up

style1.table {
  background-color: red;
  color:greenyellow;
}

style1.tr {
border-bottom: 1px solid red
} 



  echo '<br><table class="style1">';
          
            echo '<tr> <td>';

Open in new window

Avatar of jagguy

ASKER

ok wait if I reversed the command it works

table.style1