2

Background

Use extreme tables to split tabular data across pages.

Problem

The \setupxtable command does not appear to be sufficient to force a table to split across pages.

Also, a reference to split is given twice (once in the setup and once in startplacetable), which seems redundant.

Code

\setupxtable[
  split=yes,
  header=repeat,
]

\setupxtable[head][]
\setupxtable[body][]
\setupxtable[foot][]

\starttext
\dorecurse{2}{
    \input knuth \input ward
}

\startplacetable[here, split]
\startxtable
\startxtablehead[head]
\startxrow
\startxcell[align=right] Vendor \stopxcell
\startxcell[align=middle] Phone \stopxcell
\startxcell[align=middle] Contact \stopxcell
\startxcell[align=left] \$CAD \stopxcell
\startxcell[align=left] \$USD \stopxcell
\stopxrow
\stopxtablehead
\startxtablebody[body]
\dorecurse{9}{
    \startxrow
    \startxcell[align=right] Vendor \stopxcell
    \startxcell[align=middle] 555-1212 \stopxcell
    \startxcell[align=middle] Email \stopxcell
    \startxcell[align=left] 1234.58 \stopxcell
    \startxcell[align=left] 8256.76 \stopxcell
    \stopxrow
}
\stopxtablebody
\startxtablefoot[foot]
\startxrow
\startxcell[align=right] Vendor n\stopxcell
\startxcell[align=middle] 555-1212 \stopxcell
\startxcell[align=middle] Email \stopxcell
\startxcell[align=left] 1234.58 \stopxcell
\startxcell[align=left] 8256.76 \stopxcell
\stopxrow
\stopxtablefoot
\stopxtable
\stopplacetable

\stoptext

Actual

The actual output is:

No table split

Question

What needs to change in the code to cause part of the table to be on the first page while the remainder of the table is on the second page, such that the header row is repeated?

Constraints

The code is generated, mostly, by pandoc.

Environment

Running:

mtx-context     | current version: 2018.09.13 17:41
4

When you use the placetable environment you gave to pass a placement and option keywords to the location key which will end in the first argument of the \placetable command.

When you take a look at the syntax of the \placetable command you can see that options, references and the caption use separate arguments.

Arguments for the placetable command

The placeable environment on the other hand uses only a single argument (the second argument is for userdata where you can pass whetever you want) where each argument type is passed to a key.

Arguments for the startplacetable command

To break your table across pages you have to change the line

\startplacetable[here, split]

to

\startplacetable[location={here, split}]

where you pass the split keyword to the location key of the \startplacetable command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.