If you have at least an idea regarding the maximum number of columns: here's the solution for applying certain distributions only if a certain amount of columns is given.
My example only concentrates on the principle and creates evenly distributed columns. Note that this is superfluid when using table-layout:fixed and width:100%.
You could easily extend this solution to specify the width of the first columns other than that of the remaining columns.
Say, the maximum allowed number of columns is 4 (including possible rowheaders). Given you are using tbody in your table like in the following example:
<table>
<thead>
<tr><th>X</th><th>A</th><th>B</th><th>C</th></tr>
</thead>
<tbody>
<tr><th>1.</th><td>a</td><td>b</td><td>c</td></tr>
[...]
</tbody>
</table>
CSS Code:
table{table-layout:fixed;width:100%;}
tbody>tr>*:nth-last-child(2)~*{ width:50%}
tbody>tr>*:nth-last-child(3)~*{ width:33.3%}
tbody>tr>*:nth-last-child(4)~*{ width:25%}
It says:
Apply to the following siblings of the second last element of a row: width 50%. (That's all columns except the first element, if there are at least 2 columns). If there are two, three, four or more columns, this selector is applied.
But then:
Apply to the following siblings of the third last element of a row: width 33.3%: Again: This selector works only if there are at least three elements. It overwrites the rules of the preceding selector (nth-last-child(2)), so that your columns now have the width 33.3%. This selector is not applied, if there are only two columns.
And then:
The same for four columns. It again overwrites the rules previously defined.
Be aware, that you need to define the width for each possible amount of columns. So, if there was a maximum number of 20 allowed columns, this would be 21 lines of css.
I believe that this solution is compatible with IE9+, not IE8. But I'm currently not 100% sure. See http://caniuse.com/css-sel3