Quantcast
Viewing latest article 2
Browse Latest Browse All 5

Answer by Fred for Using text-align center in colgroup

With the following CSS, you can just append one or more classes to the the table element in order to align its columns accordingly.

CSS

.col1-right td:nth-child(1) {text-align: right}.col2-right td:nth-child(2) {text-align: right}.col3-right td:nth-child(3) {text-align: right}

HTML

<table class="col2-right col3-right"><tr><td>Column 1 will be left</td><td>Column 2 will be right</td><td>Column 2 will be right</td></tr></table>

Example: http://jsfiddle.net/HHZsw/


Viewing latest article 2
Browse Latest Browse All 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>