Tables
Render HTML tables with Takumi, set column widths, and understand differences from browser table layout.
Takumi renders display: table by rewriting the table into a grid before layout, so every row shares one set of column tracks. It is a naive implementation, not the CSS table algorithm. This page lists what carries over and where it drifts.
What works
<table>,<thead>,<tbody>,<tfoot>,<tr>,<td>,<th>, and<caption>have element presets in HTML and JSX.- Header groups render first and footer groups last, whatever the source order.
colspanandrowspanspan tracks. The HTML attributes and the JSXcolSpan/rowSpancasings both count.captionrenders above the table, or below it withcaption-side: bottom.- A row's background is copied to cells that have none of their own, so zebra striping and header bands work. The
border-spacinggaps stay unpainted. border-spacingdefaults to2px. Setgapon the table to change it.- Paged PDF output splits rows across pages. Column positions stay identical on every page.
< ={{ : "100%" }}>
<>
< ={{ : "#e2e8f0" }}>
<>Name</>
< ={{ : "80px" }}>Qty</>
</>
</>
<>
<>
<>Wireframe kit</>
<>3</>
</>
</>
</>Where it drifts
| Behavior | In a browser | In Takumi |
|---|---|---|
| Auto column widths | Grow in proportion to their content | Share free space equally |
vertical-align | baseline aligns the first baselines of a row | top, middle, and bottom follow the browser. baseline falls back to top |
border-collapse | Merges adjacent borders | Not implemented; borders stay separate |
| Row borders | Drawn on the row box | Dropped; put borders on the cells |
The width drift appears when the table is wider than its content and the free space splits across two or more auto columns, fixed-width neighbors included. Declare a width on a single-column cell in each column to keep the columns close to Chrome. A width on a spanning cell does not size a column.
Cells keep their box: padding, borders, and backgrounds cover the full grid area, including rows
spanned by rowspan.
Upstream table layout
Native CSS table layout for Taffy is proposed in DioxusLabs/taffy#1094. The PR is open as of September 9, 2026. Takumi currently uses the grid-based approximation described above.
Last updated on