Files
rust_browser/tests/goldens/fixtures/189-table-col-width.html
Zachary D. Rowitsch 56453a5677
All checks were successful
ci / fast (linux) (push) Successful in 6m58s
Add <col>/<colgroup> column width hints and span support (CSS 2.1 §17)
Extract width and span metadata from <col>/<colgroup> DOM elements and
apply them as column width hints during table layout. This enables
authors to declaratively set column widths via HTML attributes or CSS
without relying on cell content.

Key changes:
- UA stylesheet: col/colgroup get display:none (metadata-only, no boxes)
- HTML attrs: dedicated width-only extraction for col/colgroup elements
- ColumnInfo struct on LayoutBox stores per-column width hints
- DOM walker extracts col/colgroup metadata with span expansion and
  colgroup-to-col width inheritance (CSS 2.1 §17.3)
- Width hints integrated into both intrinsic and available-width table
  sizing algorithms with correct fixed-before-percentage ordering
- HTML parser: implicit colgroup closing by tr/tbody/thead/tfoot

Deferred: column backgrounds, visibility:collapse, column borders in
collapsed border model.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 10:57:39 -05:00

27 lines
343 B
HTML

<!DOCTYPE html>
<html>
<head>
<style>
table { border: 1px solid black; }
td { border: 1px solid gray; padding: 5px; }
</style>
</head>
<body>
<table>
<col width="200">
<col width="100">
<col>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
<tr>
<td>D</td>
<td>E</td>
<td>F</td>
</tr>
</table>
</body>
</html>