#Multiple cells table header

11 messages · Page 1 of 1 (latest)

alpine flint
#

Hi, I need the table header as shown in the image.

    table.header(
      table.cell(rowspan: 2)[*Type*],
      table.cell(rowspan: 1, colspan: 3)[*Materials*],
      table.cell(rowspan: 2)[*Maximum pressure (bar)*],
      table.cell(rowspan: 2)[*Applications*]),

The snippet above did not give the desired outcome as shown with the second image.

loud mulch
#

You appear to not have specified Metal, Composite and Polymer inside the header, unless I'm missing something

#

If this is about the stroke, you can set a stroke of (x, y) => if y <= 1 { (bottom: gray + 0.5pt) } else { none } and add a table.hline at the top and bottom

alpine flint
#

?r ```
#figure(
table(
columns: (auto, auto, auto, auto, auto),
align: center + horizon,
fill: (col, row) => if row == 0 {green} else {(gray, white).at(calc.rem(row, 2))},
inset: (x: 1em, y: 0.7em),
stroke: none,

/* --- header --- */
table.header(
  table.cell(rowspan: 2)[*Type*],
  table.cell(rowspan: 1, colspan: 3)[*Materials*],
  table.cell(rowspan: 2)[*Maximum pressure (bar)*]),
/* -------------- */
[I], [Steel/Al], [/], [/], [Al: 175\ Steel: 200],
[II], [Steel/Al liner],[Filament windings around the cylinder part], [/], [Al/glass: 263\ Steel/carbon fibre: 299],
[III], [Al/Steel liner],[Composite over-wrap (fibre glass/aramid or carbon fibre)], [/], [Al/glass: 305\ Al/aramid: 438\ Al/carbon: 700],

[IV], [/], [Composite over-wrap (carbon fibre)], [Polymer liner], [350 (buses)\ 700],

[V], [/], [Composite], [/], [1000]

),
kind: table,
caption: [Overview of tank Types with maximal bearbale pressures. ],
)<tab_0>

alpine flint
#

@loud mulch you are right, I did not add Metal, Composite and Polymer inside the header, because I was expecting them to be added after the header section. If I have to change something within the header, then I do not know how to?

#

[I], [Steel/Al], [/], [/], [Al: 175\ Steel: 200], is the first entry after the header section. This section, however, is not being drawn within the empty white space of material. I hope you get what I am saying? If not please let me know and I inshallah try to rephrase a bit.

loud mulch
#

The two first rows are exclusive to the header, anything placed after the header will not go in the first two rows

cursive sedge
#

?r

#set page(width: 210mm)
#figure(
  table(
    columns: 6,
    align: top+left,
    stroke: none,
    
    /* --- header --- */
    table.hline(stroke: .5pt),
    table.header(
      table.cell(rowspan: 2)[*Type*],
      table.cell(colspan: 3)[*Materials*], table.hline(stroke: .5pt),
      table.cell(rowspan: 2)[*Maximum\ pressure (bar)*],
      table.cell(rowspan: 2)[*Applications*],
      [*Metal*],
      [*Composite*],
      [*Polymer*],
    ),
    table.hline(stroke: .5pt),
    /* -------------- */
    [I], [Steel/Al], [/], [/], [Al: 175\ Steel: 200],[Submarine applications],
    table.hline(stroke: .5pt),
  ),
  caption: [Overview of tank Types with maximal bearbale pressures. ],
)<tab_0>