Looking to align columns in a table based on a class on the header? Consider the example below:
<table>
<thead>
<th>Name</th>
<th class="price">Price</th>
</thead>
<tbody>
....
</tbody>
<table>
While :nth-of-type can be used, it may not always be predictable. The column position could vary or multiple columns may need to be aligned to the right.
Is there a solution for this query? Legacy browsers, including Internet Explorer 9, are not a concern. Chrome and Firefox compatibility will suffice.
To clarify, the goal is to align text in body columns with their associated header column.