rassul Posted March 21, 2013 Share Posted March 21, 2013 I have the following table. I need to change the font for the 'Population' column only so the numbers are lined up. How is it done in CSS so I don't have to do it row by row? Thanks in advance. <!DOCTYPE html><html><head> <meta charset="utf-8"> <title></title> <style type="text/css" media="screen"> tr:nth-of-type(2n+3) { background-color: #C0C0C0 ; } </style></head><body> <div id="container"> <table border="1" align="center" bgcolor="white"> <th>Country</th> <th>Capital</th> <th>Population</th> </tr> <tr> <td>Algeria</td> <td>Algiers</td> <td>35,980,193</td> </tr> <tr> <td>Belgium</td> <td>Brussels</td> <td>11,008,0000</td> </tr> <tr> <td>Chad</td> <td>N'Djamena</td> <td>11,525,496</td> </tr> <tr> <td>Chad</td> <td>N'Djamena</td> <td>11,525,496</td> </tr> </table> </div></body></html> Link to comment Share on other sites More sharing options...
Labtec Posted March 21, 2013 Share Posted March 21, 2013 I don't understand your question. Lined up how? They are line up. How is the font going to line them up? Regards, Lab. Link to comment Share on other sites More sharing options...
rassul Posted March 21, 2013 Author Share Posted March 21, 2013 I need to simply use a different fonts for that one column only. Link to comment Share on other sites More sharing options...
dsonesuk Posted March 21, 2013 Share Posted March 21, 2013 target every 3rd td cell of parent (tr) td:nth-of-type(3) { font-family: Helvetica } 2 Link to comment Share on other sites More sharing options...
rassul Posted March 21, 2013 Author Share Posted March 21, 2013 Thanks dsonesuk, it worked. Link to comment Share on other sites More sharing options...
Labtec Posted March 22, 2013 Share Posted March 22, 2013 Never seen that before dsonesuk, thanks very much. Do you have any good CSS sites I could learn CSS3 psuedo classes from? Kind regards, Lab. Link to comment Share on other sites More sharing options...
scout1idf Posted March 22, 2013 Share Posted March 22, 2013 You can try here.. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now