diff options
| author | PgBiel <9021226+PgBiel@users.noreply.github.com> | 2025-06-12 02:17:11 -0300 |
|---|---|---|
| committer | PgBiel <9021226+PgBiel@users.noreply.github.com> | 2025-06-28 22:39:35 -0300 |
| commit | f9b1bfd1b034b12e57d892034b8caf9c34661803 (patch) | |
| tree | 35278e58ef062ff5d37f2fa8af922c39fcc07533 | |
| parent | b26e004be98ea437b3fa60cd0b397a2787862004 (diff) | |
fix tfoot in table html
| -rw-r--r-- | crates/typst-library/src/model/table.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/typst-library/src/model/table.rs b/crates/typst-library/src/model/table.rs index 367d3e66..91795398 100644 --- a/crates/typst-library/src/model/table.rs +++ b/crates/typst-library/src/model/table.rs @@ -297,7 +297,7 @@ fn show_cellgrid_html(grid: CellGrid, styles: StyleChain) -> Content { // appear to be an equivalent of 'th' for footers in HTML.) // TODO: test let footer = { - let mut consecutive_footer_start = grid.footers.len(); + let mut consecutive_footer_start = grid.rows.len(); let footers_at_end = grid .footers .iter() @@ -312,7 +312,9 @@ fn show_cellgrid_html(grid: CellGrid, styles: StyleChain) -> Content { if footers_at_end > 0 { let last_mid_table_footer = grid.footers.len() - footers_at_end; - let rows = rows.drain(last_mid_table_footer..); + let removed_footer_rows = + grid.footers.get(last_mid_table_footer).unwrap().start; + let rows = rows.drain(removed_footer_rows..); Some(elem(tag::tfoot, Content::sequence(rows.map(|row| tr(tag::td, row))))) } else { |
