css & xhtml >.<

Associate
Joined
7 Nov 2004
Posts
1,755
Location
Southampton/Oxford
right i have a problem thats been buggin me for ages!!


my html
Code:
<table class="pricetable" width="33%" border="3" cellpadding="2" cellspacing="1" >
  <tr> 
    <th colspan="3">Price Table</th>
  </tr>
  <tr> 
    <td class ="pay">Pay according to month:</td>
    <th class ="silver" align="centre">Silver Membership</th>
    <th class ="gold" align="center">Gold Membership</th>
  </tr>
  <tr class ="row1"> 
    <td><div align="center">September</div></td>
    <td><div align="center">&pound;90</div></td>
    <td><div align="center">&pound;105</div></td>
  </tr>
  <tr class = "row2"> 
    <td><div align="center">October</div></td>
    <td><div align="center">&pound;85</div></td>
    <td><div align="center">&pound;100</div></td>
  </tr>
  <tr class = "row3"> 
    <td><div align="center">November</div></td>
    <td><div align="center">&pound;80</div></td>
    <td><div align="center">&pound;95</div></td>
  </tr>
  <tr class ="row4"> 
    <td><div align="center">December</div></td>
    <td><div align="center">&pound;75</div></td>
    <td><div align="center">&pound;90</div></td>
  </tr>

my css
Code:
tr.exchnage
{

text-align: center;

}

table}
text-align:center;
}


and i havn't put all of the html and css because its long but anyways im trying to align all the text in the table center and add text colour to some of the cells of one colour and another cells another, can someone help me!?

like this #
 
DragonWoLf said:
Code:
tr.exchnage
{

text-align: center;

}

table}
text-align:center;
}
Possible errors I can see in that are
  1. The first brace for your table rule is the wrong way round. } => {
  2. tr.exchnage - is that a typo? Should it be 'tr.exchange'?
Code:
tr.exchange, table {
text-align: center;
}
 
The table is missing the closing tag as well. :)
Code:
</table>
You maybe missed that when you copied it over.

If you want to highlight the columns instead of the rows, then you could do the following; -

HTML
Code:
<tr class ="row1"> 
	<td [b][color=Yellow]class="col1"[/color][/b]><div align="center">September</div></td>
	<td [color=Yellow][b]class="col2"[/b][/color]><div align="center">&pound;90</div></td>
	<td [color=Yellow][b]class="col3"[/b][/color]><div align="center">&pound;105</div></td>
  </tr>
CSS
Code:
.col1{color:#FF0000;}
.col2{color:#0000FF;}
.col3{color:#00FF00;}
That would give you three different colours for each column. You'd have to apply the col classes to the other three rows as well. That seems a bit long winded, but I can't think of another way at the minute.

This is what it looks like.
 
Last edited:
thanks a lot Mr, Mastermind and Aug, really helped but thanks to ya Mr L, ya understood meh while me tutor got confused! git! cheers dudes!
 
Back
Top Bottom