What is the behavior with the sum of the column widths! = Width of the table?

I have a table with a fixed width of 800.

I noticed that when the column width is not up to 800, my browser (Chrome) will arbitrarily select one column to increase the size (maybe several, I'm not sure).

Also, when I make the sum of the column widths> 800, it just accepts it.

Is there a standard behavior for how a browser should behave when the sum of the column widths is not equal to the width of the table?

+6
source share
1 answer

Yes, that seems like the right behavior.

According to the specification, user agents (browsers) are sent to the "reflow" columns, if necessary

If the column widths are too narrow for the contents of a specific table cell, user agents can choose to pay for the table.

http://www.w3.org/TR/html4/struct/tables.html#column-width

Moreover,

User agents can use any algorithm that they want to do, and they can freely prefer the transmission speed over accuracy, except when the "fixed layout" algorithm ".

More here

http://www.w3.org/TR/CSS2/tables.html#width-layout

+4
source

Source: https://habr.com/ru/post/902269/


All Articles