Fixed tables with padding: Compute column computed widths from assignable table width

This test is the similar to table-width-redistribution-fixed.html, except that all cells have 6px padding. The comments in this test refer to padding incompatibilities only.

Percentage sizes and box-sizing are handled differently in FF/Chrome. In Chrome, %ge size is always treated as border-box size: column width = % * table width. In FF, box-sizing:content-box, %ge size is % * table width + border_padding, box-sizing:border-box same as Chrome.

Fixed only

Table: 50px; C0:100/50/100 C1:100/50/100 When table.css_width is < columns.css_width, how is the conflict resolved? columns.css_width wins

50
50
50
25

Table: 300px; C0:100/100/200 C1:100/90/115 When table.css_width is > columns.css_width , how is the conflict resolved? table.css_width wins

100
100
90
25

Table: 300px; C0:100/50/50 C1:100/100/100 Fixed cells must grow, but their min widths differ. Fixed cells grow in proportion to their css width.

50
100

Table: 50px; C0:100/50/50 C1:100/100/100 What happens when column.min_width > column.css_width column.css_width wins over column.min_width.

Table: 1px. What happens to min_width when multiple cells specify css_width of the same column? 1st cell wins.

200
150

Colspan distribution

Table: 1px Does column.min_width change with colspan distribution from later rows to first row? No

Colspan header cells

  1. Fixed/percentage colspan cells get distributed evenly.
  2. Auto cells. Is the table even fixed?

Assi: 300px To make CO distributable width 100, declare it as 100px+8px spacing - 12px padding. To make C1 distributable width 200, declare it as 220px+8px spacing - 12px padding. Fixed header cells with colspan get divided evenly.

Legacy chrome does not substract border spacing before distribution

108 208
1 1 1 1

Assignable: 400px, C0:40% C1:20% C2:40% Percentage header cells with colspan. Colspan cells do not distribute border_padding, they just distribute widths. C0/1/2/3 will not have border-padding becaouse of colspan, C4 because border-box TD0 splits C0/1 get 20% max (40 + padding)/ 2 = 22px, C2/3 10% and (20 + padding) / 2 = 12px max, C4 40%, 12px percent border padding, and 52 max Assignable width is 440 - 48, everyone gets according to percent. C0/C1 get 80, C2/C3 get 40, and C4 gets 160.

Firefox seems to have a rounding error.

Auto Auto Auto Auto Auto

Assignable: 1px, C0 Auto/100 colspan=2 , C1 100/Auto Auto header cells with colspan, table is min width min_width does not get redistributed.

100
100
x x x

Assignable: 200; C0: colspan:2 Auto C1:colspan 8 Auto Auto colspan cells, and nothing else. Tricky because this means that internally table has to represent 10 cells, and wide cells that span beyond table width are usually truncated. C0: 20*2+8=48, C1: 20*8 + 7*8=216

Percentage only

Assignable: 100px;columns add to 100%, auto width Column percent adds to a 100, but because box-sizing is content box, Column content size adds up to table width. Column border size adds up to table width + padding (36px). Columns get scaled down. Scaling down is not defined by standard. FF and NG differ by a px (rounding?).

50% 30% 20%

Assignable: 100px;columns add to 50%, auto width Columns grow proportional to percent. Slight rounding differences between NG and FF.

25% 15% 10%

Assignable: 100px;columns add to 50%, with min width Min width is ignored.

50
50
50

Percentage/auto/fixed mix

Assignable: 100px;C0:50% C1:100px Clean split

50% 50px

Assignable: 100px;C0:60% C1:60px Overconstrained: widths add up to 132. Fixed widths get distributed first, percentage takes the rest.

20% 60% 60px