Make columns of equal width in <table>
How to make columns equal width in?
Dynamically change the number of columns.
Today I have 13 columns. Tomorrow will be the race 16. Everyone does not really want to count.
+47
Michael Phelps Dec 04 '13 at 12:23 2013-12-04 12:23
source share3 answers
I think this will do the trick:
table{ table-layout: fixed; width: 300px; } +92
Adam Luniewski Dec 04 '13 at 12:27 2013-12-04 12:27
source shareUse the following property, similar to a table and its fully dynamic:
ul { width: 100%; display: table; table-layout: fixed; /* optional, for equal spacing */ border-collapse: collapse; } li { display: table-cell; text-align: center; border: 1px solid pink; vertical-align: middle; } <ul> <li>foo<br>foo</li> <li>barbarbarbarbar</li> <li>baz klxjgkldjklg </li> <li>baz</li> <li>baz lds.jklklds</li> </ul> Perhaps this will solve your problem.
+8
Divya Bhalodiya Dec 04 '13 at 12:31
source shareFound this on an HTML table: keep the same width for columns
If you set the style of table-layout: fixed; on your table, you can override the resizing of the browser column. The browser will then set the width of the columns based on the width of the cells in the first row of the table. Change and remove from it, and then set the fixed widths for the cells in.
+5
Nitin Varpe Dec 04 '13 at 12:27 2013-12-04 12:27
source share