I have a stylesheet.
In the stylesheet I set the table,th,td tags with specific attributes. One of the attributes is that I want th tags to all have
text-align: left;
I made a special class for when I want a th to be right aligned.
text-align : right;
In my code, I set <th class="RIGHTALIGNTH">
but the th continues to stay left aligned.
if i do an explicit align="right" in the tag, it works, but not if I use a class.
Any ideas?
Th class override
Hi Vivaldi,
Sounds like it should work.
Could you post a link to a test page, so we can have a look.
Hmm
I wish I had a place available to post it on the web [ intranet app ].
I will post some code so its an easy test.
the css file:
Table{
border : none;
width : 650px;
}
td{
font : Times New Roman;
font-size : 13px;
text-decoration : none;
}
th{
font : Times New Roman;
color : Black;
font-size : 14px;
font-weight : bold;
text-decoration : none;
}
FTH{
font : Times New Roman;
color : Black;
font-size : 14px;
font-weight : bold;
text-decoration : none;
text-align: right;
}
Thats the css file.
The html (asp file).
<html>
<head>
<title>Test</title>
<link rel="stylesheet" href="civil.css">
</head>
<body >
<table align="center">
<tr>
<th >Court Case #:</th>
<td>EM99999999</td>
</tr>
<tr>
<th class="FTH">Process #:</th>
<td>10222</td>
</tr>
</table>
</body >
</html>
Notice how Process # and Court Case have the same alignment, and shouldn't. Is there no way to override the stylesheet's hold on the alignment?
Thanks for the time.
Th class override
The top three CSS declarations are referenced to an actual HTML tag (table, td, th). But the fourth is a class so needs to be declared like this (with a .):
.FTH { text-align: right; }
Note that the styles cascade, so as the FTH class is used in a TH cell, all the repeated guff doesn't need to be there, it will take both bits of the CSS.
danke
Thanks,
I knew that I needed the . , I guess its been that kind of week.
Thanks for the advice, it was getting frustrating.