1

I am using tabulate to make a table that spans a few pages, but I need to place a caption over that table. Putting it inside \startplacetable and \stopplacetable makes it float, which is not wanted. I am unsure what to do because I have never used tabulate or made any long tables before. Please help. Thanks.

1 Answer 1

0

I am using tabulate to make a table that spans a few pages, but I need to place a caption over that table.

From the wiki:

Titles

A tabulating environment can have an optional name which will be repeated above at every page break that occurs inside the table. This name needs to be specified as the argument of the title key of \setuptabulate. The header key has to be set to text for this to work.

\setuppapersize[A10, landscape][A8, landscape]
\setuppaper[nx=2,ny=2]
\setuparranging[XY]

\switchtobodyfont[5pt]
\setuppagenumbering[location={header,inright}]
\showframe[edge]

\setuptabulate
   [split=yes,
    header=text,
    title={\color[red]{Fenchurch St. Paul}\strut},
    frame=on]

\starttext
\starttabulate[|p(1.2cm)|p(1.2cm)|]
\dorecurse{6}{
  \NC  Bells:  \NC  Tin tan din dan bim bam bom bo \NC\NR
  \HL
  \NC  Name:  \NC  Tailor Paul \NC \NR                                              
  \HL
}
\stoptabulate
\stoptext

code output

Putting it inside \startplacetable and \stopplacetable makes it float, which is not wanted.

You can use location=force to make a “float” not actually float:

% To show multiple pages in a single page
\setuppapersize[A6][A4]
\setuppaper[nx=2, ny=2]
\setuparranging[XY]
\showframe[edge]

% Set up the table formatting
\setupcaptions[table][location=top]
\setupfloat[table][align=middle]

\starttext
    \startplacetable[
        title={Table title},
        location={force, split},
    ]
        \startTABLE[
            split=yes,
            leftframe=off,
            rightframe=off
        ]
            \dorecurse{10}{
                \NC One   \NC Two   \NC\NR
                \NC Three \NC Four  \NC\NR
                \NC Five  \NC Six   \NC\NR
                \NC Seven \NC Eight \NC\NR
                \NC Nine  \NC Ten   \NC\NR
            }
        \stopTABLE
    \stopplacetable
\stoptext

code output

3
  • I may not be clear., sorry. I need the caption that will show in List of Table. The caption should just appear once of course. Aug 7, 2023 at 1:17
  • @MuhammadRizqiSiregar The second solution should show up in the list of tables. You might need to add a reference= key to make it work though. Aug 7, 2023 at 2:30
  • 1
    Missed the reference= part. This works perfectly. Thanks. Aug 7, 2023 at 2:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .