I am working with multiple tables that share similarities, but differ in the number of columns each table has. I am looking to create a styling rule where depending on the number of columns, the width of each column will be set accordingly. For example, if there are 2 columns, the first td should be 80% and the second one should be 20%. If there are three columns, they should be 45%, 45%, and 10% respectively.
Is there a way to achieve this using CSS? And if not, how can it be done using JQuery?