update tests with non-top header

This commit is contained in:
PgBiel 2025-04-07 20:43:12 -03:00
parent 5e2241ab65
commit 8e50df544d
5 changed files with 24 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

View File

@ -118,16 +118,12 @@
) )
--- grid-header-not-at-first-row --- --- grid-header-not-at-first-row ---
// Error: 3:3-3:19 header must start at the first row
// Hint: 3:3-3:19 remove any rows before the header
#grid( #grid(
[a], [a],
grid.header([b]) grid.header([b])
) )
--- grid-header-not-at-first-row-two-columns --- --- grid-header-not-at-first-row-two-columns ---
// Error: 4:3-4:19 header must start at the first row
// Hint: 4:3-4:19 remove any rows before the header
#grid( #grid(
columns: 2, columns: 2,
[a], [a],
@ -463,8 +459,6 @@
#table( #table(
columns: 3, columns: 3,
[Outside], [Outside],
// Error: 1:3-4:4 header must start at the first row
// Hint: 1:3-4:4 remove any rows before the header
table.header( table.header(
[A], table.cell(x: 1)[B], [C], [A], table.cell(x: 1)[B], [C],
table.cell(x: 1)[D], table.cell(x: 1)[D],

View File

@ -0,0 +1,24 @@
--- grid-subheaders ---
#set page(width: auto, height: 12em)
#let rows(n) = {
range(n).map(i => ([John \##i], table.cell(stroke: green)[123], table.cell(stroke: blue)[456], [789], [?], table.hline(start: 4, end: 5, stroke: red))).flatten()
}
#table(
columns: 5,
align: center + horizon,
table.header(
table.cell(colspan: 5)[*Cool Zone*],
),
table.header(
level: 2,
table.cell(stroke: red)[*Name*], table.cell(stroke: aqua)[*Number*], [*Data 1*], [*Data 2*], [*Etc*],
table.hline(start: 2, end: 3, stroke: yellow)
),
..rows(6),
table.header(
level: 2,
table.cell(stroke: red)[*New Name*], table.cell(stroke: aqua, colspan: 4)[*Other Data*],
table.hline(start: 2, end: 3, stroke: yellow)
),
..rows(5)
)