I have a table with a fixed width of 800.
I noticed that when the column widths don't add up to 800, my browser (Chrome) will arbitrarily choose one column to increase in size (could be more than one, I'm not sure).
Also, when I make the sum of the widths of the columns > 800, then it just accepts it.
Is there a standard behavior of how a browser should behave when the sum of the widths of the columns do not equal the width of the table?
On the Page Layout or Layout tab, click Columns. At the bottom of the list, choose More Columns. In the Columns dialog box, adjust the settings under Width and spacing to choose your column width and the spacing between columns. If you want columns of varying widths, deselect the checkbox next to Equal column width.
The width of the columns i.e. td in a table can be fixed very easily. This can be done by adding the width attribute in the <td> tag. If the width is not specified, the width of the column changes according to the change in the content. The specifications of width for the columns can be in pixels, or percentage.
Change column width To change the width to a specific measurement, click a cell in the column that you want to resize. On the Layout tab, in the Cell Size group, click in the Table Column Width box, and then specify the options you want.
10. Which of the following does not specify a column width? Explanation: We can specify column width in three ways i.e. Percentage, Fixed, Proportional. Fixed width is given in pixels.
Yes, it seems to be proper behavior.
According to the spec, user agents (browsers) are directed to "reflow" columns as necessary
If column widths prove to be too narrow for the contents of a particular table cell, user agents may choose to reflow the table.
http://www.w3.org/TR/html4/struct/tables.html#column-width
Also,
User agents may use any algorithm they wish to do so, and are free to prefer rendering speed over precision, except when the "fixed layout algorithm" is selected.
See more here
http://www.w3.org/TR/CSS2/tables.html#width-layout
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With