0

Is it possible to ensure that in the xltabular the endlastfoot is always on the bottom on the page near the foot and if there is a new page, that there is at least one row element in the table and not just the endlastfoot like in my following example?

Edit: The table is filled by a script, so the number of row elements is arbitrary, it might be just one.

Here is my desired page with the end of the table:enter image description here

and here is my table:

\documentclass{article}

\usepackage[margin=0.7in]{geometry}
\usepackage{xltabular}

\begin{document}

\newcolumntype{R}{>{\raggedleft\arraybackslash}X}%
\begin{xltabular}{\textwidth}{R X X R R R}
    
    Firstttttttt & Second & Third & Forth & Fifth & Lasttttttt \\ \hline 
    \endfirsthead

    Firstttttttt & Second & Third & Forth & Fifth & Lasttttttt \\ \hline 
    \endhead
    
    \hline
    \multicolumn{6}{l}{Bla}
    \endlastfoot
    
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
\end{xltabular}  

\end{document}

1 Answer 1

0

enter image description here

You can force a page break before the last row

\documentclass{article}

\usepackage[margin=0.7in]{geometry}
\usepackage{xltabular}

\begin{document}

\newcolumntype{R}{>{\raggedleft\arraybackslash}X}%
\begin{xltabular}{\textwidth}{R X X R R R}
    
    Firstttttttt & Second & Third & Forth & Fifth & Lasttttttt \\ \hline 
    \endfirsthead

    Firstttttttt & Second & Third & Forth & Fifth & Lasttttttt \\ \hline 
    \endhead
    
    \hline
    \multicolumn{6}{l}{Bla}
    \endlastfoot
    
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
\pagebreak
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\[\fill]
\end{xltabular}  

\end{document}
4
  • Sorry, I forgot to mention that the table is created by a script with an arbitrary number of row elements, so it might be just few so I don't even need a page break.
    – Namal
    Sep 2, 2021 at 9:31
  • @Namal sure but sometimes you may need manual correction, you could always put the last row in the last foot to keep it on the last page, but not if you also want to add the fill glue. Sep 2, 2021 at 9:35
  • 1
    @Namal or you can not do the \pagebreak and use \\*[\fill] so it doesn't break after the last row, that might be better for you Sep 2, 2021 at 9:39
  • Carliste that seems to do exactly what I expect!
    – Namal
    Sep 2, 2021 at 9:42

You must log in to answer this question.

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