3 replies [Last post]
forum Guy
Offline
newbie
Last seen: 18 years 35 weeks ago
Joined: 2003-11-03
Posts: 10
Points: 0

Say I have a style:

.myTable TD{
  padding: 1px 3px 1px 3px;
  border-bottom: 1px solid ButtonFace;
  border-right-color: ButtonFace;
  border-right-style: solid;
  border-right-width: 1px;
  border-left-color: ButtonFace;
  border-left-style: solid;
  border-left-width: 1px;
  background-color: #FCFCFC;
  font-family:Arial, sans-serif;
  color:black;
  font-size:8pt;
  font-weight: normal;
}

and I wish to apply another style to a TD element within the same table.
<td class="classForThisTd" ></td>
The assigned class is not being rendered. Does anyone know how to override the inherited style or possible suggest a way to accomplish this.
Thank you,
FI

ClevaTreva
ClevaTreva's picture
Offline
Guru
A hilly place, UK
Last seen: 3 years 35 weeks ago
A hilly place, UK
Joined: 2004-02-05
Posts: 2902
Points: 0

Overriding inherited styles

Hi

In the style, you could try adding !important to the end of the style, e.g.

height:100px !important;

Or you could try putting an id in the cell and setting the style on the id (Id overrides other styling), e.g.

<td id="tryme">

Trevor

dJomp
dJomp's picture
Offline
Enthusiast
Last seen: 6 years 22 weeks ago
Joined: 2003-03-23
Posts: 422
Points: 0

Overriding inherited styles

Can you post the actual code if the above does not work? It could be something as tiny as missing one capital letter...

You know you're a geek when you try to shoo a fly away from the monitor with your cursor.

forum Guy
Offline
newbie
Last seen: 18 years 35 weeks ago
Joined: 2003-11-03
Posts: 10
Points: 0

Overriding inherited styles

This is what I did, I wrapped the my target td within another table and assigned a style to it:

<table class="ScrollerTable" cellspacing="0" cellpadding="0">

I then created:
.ScrollerTable TD{
    font-family:Arial, sans-serif;
    color:black;
    font-size:8pt;
    font-weight: normal;
    text-align: right;
    background-color: #EAEAEA;
    padding-left:  2px;
    padding-right: 3px;
    padding-top: 	5px;
    padding-bottom:3px;
    border-bottom: 0px solid ButtonFace;
    border-right-color: ButtonFace;
    border-right-style: solid;
    border-right-width: 0px;
    border-left-color: ButtonFace;
    border-left-style: solid;
    border-left-width: 0px;
  }

This solved my problems, thank you all for the time.
FI