How to make *table header* apere on the second page, but not on first

I need to put the header in new page of table, but the first page must have a line above header, now i making it manually but its going to be real “quality of live” improvement.
Example code and screenshots below

#let table-multi-page(continue-header-label: [], ..table-args) = context {
  let columns = table-args.named().at("columns", default: 1)
  let column-amount = if type(columns) == int {
    columns
  } else if type(columns) == array {
    columns.len()
  } else {
    1
  }

  // Check as show rule for appearance of a header or a footer in grid if value is specified
  let label-has-content = value => value.has("children") and value.children.len() > 0 or value.has("text")

  // Counter of tables so we can create a unique table-part-counter for each table
  let table-counter = counter("table")
  table-counter.step()

  // Counter for the amount of pages in the table
  let table-part-counter = counter("table-part" + str(table-counter.get().first()))

  show <table-header>: header => {
    table-part-counter.step()
    context if (table-part-counter.get().first() != 1) and label-has-content(continue-header-label) {
      header
    }
  }

  grid(
    inset: 0mm,
    row-gutter: 2mm,
    grid.header(grid.cell(align(right + bottom)[ #text(style: "italic")[#continue-header-label <table-header>] ])),
    ..table-args,
  )
}


#figure(caption: [Токсикологічні показники безпечності питної води], 
  table-multi-page(continue-header-label: [Продовження таблиці @tab29[]],
    table(columns: 4, 
      [№ п\п], [Назва показника], [Одиниці вимірювання], [Норматив, не більше ніж \ Вода системи централізованого питного водопостачання],
      [1], [2], [3], [4], // header
      table.cell(colspan: 4)[Неорганічні компоненти],
      [1], [Алюміній], [мг/#dmq], [0,2 (0,5)],
      [2], [Амоній (за $N H_4^+$)], [мг/#dmq], [0,5 (2,6)],
      [3], [Барій], [мг/#dmq], [0,1],
      [4], [Берилій], [мг/#dmq], [0,0002],
      [5], [Бор], [мг/#dmq], [0,5],
      [6], [Кадмій], [мг/#dmq], [0,001],
      [7], [Кобальт], [мг/#dmq], [0,1],
      [8], [Миш'як], [мг/#dmq], [0,01],
      [9], [Молібден], [мг/#dmq], [0,07],
      [10], [Нікель], [мг/#dmq], [0,02],
      [11], [Нітрати (за $N O_3^-$)], [мг/#dmq], [50],
      [12], [Нітрати (за $N O_2^-$], [мг/#dmq], [0,5 (0,1)],
      [13], [Перхлорати], [мг/#dmq], [0,01],
      [14], [Ртуть], [мг/#dmq], [0,0005],
      [15], [Свинець], [мг/#dmq], [0,01],
      [16], [Селен], [мг/#dmq], [0,01],
      [17], [Стронцій], [мг/#dmq], [7],
      [18], [Сурма ($S b$)], [мг/#dmq], [0,005],
      [19], [Талій], [мг/#dmq], [0,0001],
      [20], [Фториди ($F^-$) Для кліматичних районів: \ ІІ \ ІІІ \ ІV], [мг/#dmq], [ \ 1,5 \ 1,2 \ 0,7], 
      [21], [Хром загальний], [мг/#dmq], [0,05],
      [22], [Ціаніди ($C N^-$), зокрема цианоген хлорид], [мг/#dmq], [0,05],
      [23], [Діоксид хлору], [мг/#dmq], [0,1],
      [24], [Кремній], [мг/#dmq], [10],
      [25], [Натрій], [мг/#dmq], [200],
      [26], [Озон залишковий], [мг/#dmq], [0,1-0,3],
      [27], [Хлорити], [мг/#dmq], [0,2],
      table.cell(colspan: 4)[Органічні компоненти],
      [28], [Бенз(а)пірен], [мг/#dmq], [0,000005],
      [29], [Бензол], [мг/#dmq], [0,001],
      [1], [2], [3], [4], //header
      [30], [Пестииди (сума)], [мг/#dmq], [0,0005],
      [31], [Синтетичні аніоноактивні поверхнево-активні речовини (АПАР)], [мг/#dmq], [0,5],
      [32], [Трихлоретилен і тетрахлоретилен], [мг/#dmq], [0,01],
      [33], [Чотирихлористий вуглець], [мг/#dmq], [0,002],
      [34], [Поліакриламід залишковий], [мг/#dmq], [2,0],
      [35], [Формальдегід], [мг/#dmq], [0,05],
      [36], [Нафтопродукти], [мг/#dmq], [0,1],
      table.cell(colspan: 4)[Інтегральні складові],
      [37], [Окислюваність перманганатна], [мг О/#dmq], [5],
      [38], [Загальний органічний вуглець], [мг С/#dmq], [8],
    )
  )
,  kind: "table") <tab29>

Your example is missing ( and #let dmq = .
As for your question, you can try multiple table headers feature of v0.14.0-2025/10/24.
Typst Table Doc
GitHub Issue

Use backticks over quotes for inline code. How to post in the Questions category - #7 by Andrew

1 Like