Eiolon Posted March 25, 2009 Share Posted March 25, 2009 I have a table that holds data. It has 4 columns, 3 do not have any width restrictions but I want the 4th one to have a restriction. How do I tell my stylesheet that this particular column gets a width while the others do not? <table class="data"> <tr> <th>Name</th> <th>Address</th> <th>Phone</th> <th align="center"></th> </tr> <tr> <td></td> <td></td> <td></td> <td align="center"></td> </tr> </table> table.data { width: 100%; border: 1px; border-collapse: collapse; border-top: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-bottom: 0px solid #CCCCCC; border-right: 1px solid #CCCCCC; background-color: #FFFFFF; font-family: Arial, Helvetica, sans-serif; font-size: 13px; color: #000000 } table.data th { background-color: #E5E5E5; padding-top: 5px; padding-left: 5px; padding-right: 5px; padding-bottom: 5px; border-top: 0px solid #CCCCCC; border-left: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC } table.data td { padding-top: 5px; padding-left: 5px; padding-right: 5px; padding-bottom: 5px; border-top: 0px solid #CCCCCC; border-left: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-right: 0px solid #CCCCCC } Quote Link to comment Share on other sites More sharing options...
fry2010 Posted March 26, 2009 Share Posted March 26, 2009 <td class="set_width" align="center"></td> .set_width { width: 200px; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.