i tried my best to make as small a reproduction i could and the below is what i came up with. what i mean with the title is i have a column title (Commodity Description) and i need to span 2 columns. but i want cells under that column title to span 2 columns as well.
i have below my Typst template and JSON data, and i confirm it works if you input it in Typst app.
this is what it looks like:
Hot Dogs and Grand Total need to occupy both columns of Commodity Description
Typst:
#set text(font: "Public Sans", size: 7pt, top-edge: 0.4em)
#let data = json("data-repro.json").shipments.at(0)
#if data.carrierInfo.tableInfo.len() > 4 {
for page in data.carrierInfo.supplementalPages {
let supplementalCarrierInformation = [
#table(
columns: (10),
align: center+bottom,
table.cell(colspan: 2, inset: (top: 15pt), align: bottom)[#strong[Handling Unit]],
table.cell(colspan: 2, inset: (top: 15pt))[#strong[Package Unit]],
table.cell()[],
table.cell()[],
table.cell(colspan: 2, rowspan: 2)[
#strong[Commodity Description]
#linebreak()
Commodities require special or additional care or attention in handling or stowing must be so marked and packaged as to ensure safe transport with ordinary care. See Section 2(e) or NMFC Item 360
],
table.cell(colspan: 2, inset: (top: 15pt))[#text(red)[#strong[LTL Only]]],
table.cell()[#strong[Qty]],
table.cell()[#strong[Type]],
table.cell()[#strong[Qty]],
table.cell()[#strong[Type]],
table.cell()[#strong[Weight]],
table.cell()[#strong[H/M]],
table.cell()[#strong[Class]],
table.cell()[#strong[NMFC]],
..for row in page {(
..for value in row.values() {(
table.cell()[
#value
],
)}
)},
[],
[],
[],
[],
[],
[],
table.cell()[Grand Total],
)
]
grid(
columns: (1fr, 1fr),
inset: 5pt,
stroke: black,
grid.cell(colspan: 2)[#supplementalCarrierInformation]
)
}
}
JSON:
{
"shipments": [
{
"carrierInfo": {
"tableInfo": [
{
"huQty": 4,
"huType": "PALLET",
"packageQty": 10,
"packageType": "BOX",
"weight": 5400,
"hazmat": null,
"commodity": "Hot Dogs",
"class": 60,
"nmfc": null,
"bolPreview": null
},
{
"huQty": null,
"huType": null,
"packageQty": null,
"packageType": null,
"weight": 1000,
"hazmat": null,
"commodity": "Ketchup",
"class": 70,
"nmfc": null,
"bolPreview": null
},
{
"huQty": null,
"huType": null,
"packageQty": null,
"packageType": null,
"weight": 1000,
"hazmat": null,
"commodity": "Mustard",
"class": 55,
"nmfc": null,
"bolPreview": null
},
{
"huQty": null,
"huType": null,
"packageQty": 8,
"packageType": "BAG",
"weight": 500,
"hazmat": null,
"commodity": "Rolls",
"class": 92.5,
"nmfc": null,
"bolPreview": null
},
{
"huQty": null,
"huType": null,
"packageQty": null,
"packageType": null,
"weight": 500,
"hazmat": null,
"commodity": "Buns",
"class": 92.5,
"nmfc": null,
"bolPreview": null
}
],
"supplementalPages": [
[
{
"huQty": 4,
"huType": "PALLET",
"packageQty": 10,
"packageType": "BOX",
"weight": 5400,
"hazmat": null,
"commodity": "Hot Dogs",
"class": 60,
"nmfc": null,
"bolPreview": null
}
]
]
}
}
]
}