twilitegxa Posted September 21, 2008 Share Posted September 21, 2008 Is it possible to align an entire column in a table to the right without having to individually set a class to each table's cell? There must be a way to name the column and set a class to the column, isn't there? Please tell me if anyone knows a way. Thanks! Link to comment https://forums.phpfreaks.com/topic/125213-solved-aligning-entire-column-within-a-table-to-the-right/ Share on other sites More sharing options...
departedmind Posted September 22, 2008 Share Posted September 22, 2008 .mytable { background-color:#666666;} .mytable td { text-align:right;} You can assign the class mytable to the table and all the td inside that table will be aligned right. Link to comment https://forums.phpfreaks.com/topic/125213-solved-aligning-entire-column-within-a-table-to-the-right/#findComment-647446 Share on other sites More sharing options...
F1Fan Posted September 22, 2008 Share Posted September 22, 2008 You can add a global setting like that to ALL <td>'s, or you can add them to all with a certain class. You cannot, however, add an align-right to a whole column without adding each <td> to that class. Link to comment https://forums.phpfreaks.com/topic/125213-solved-aligning-entire-column-within-a-table-to-the-right/#findComment-647448 Share on other sites More sharing options...
dropfaith Posted September 22, 2008 Share Posted September 22, 2008 yea classing them is the best way to achieve this unless you want all your tds aligned to the right Link to comment https://forums.phpfreaks.com/topic/125213-solved-aligning-entire-column-within-a-table-to-the-right/#findComment-647449 Share on other sites More sharing options...
twilitegxa Posted September 22, 2008 Author Share Posted September 22, 2008 Okay, I was just hoping there was a way to align a whole column rather than assigning a class to each cell I wanted affected. Link to comment https://forums.phpfreaks.com/topic/125213-solved-aligning-entire-column-within-a-table-to-the-right/#findComment-647454 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.