4

I'm using supertabular in multicols enviroment based on this thread's accepted answer multicolumn long table or enumeration. But there is sometimes header and empty table body left in new column/page (eg. when i change counter "n" to 19 - first column is full and only header is in second column). I've also tried this solution How to disable pagebreak on \hline in supertabular? but it doensn't help. Number of rows I create is arbitrary. Is there a way to remove these headers with no body (without removing all headers)?

EDIT: example

    \documentclass{article}
    \usepackage[margin=1in]{geometry}
    \usepackage{xcolor,supertabular,multicol}
    \newcount\n
    \n=0
    \def\tablebody{}
    \makeatletter
    \loop\ifnum\n<19
            \advance\n by1
            \protected@edef\tablebody{\tablebody
                    \textbf{\number\n.}&
                    \hfill T\hfill\hfill F\hfill\hskip0pt\endgraf
                    \vskip.5\baselineskip
                    \color@begingroup
                    \color{black!20}
                    \hrule height3ex
                    \color@endgroup
                    \tabularnewline
            }
    \repeat
    \makeatother
    \pagestyle{empty}
    \begin{document}
    \begin{multicols*}{2}
    \let\mcnewpage=\newpage
    \makeatletter
    \renewcommand\newpage{%
            \if@firstcolumn
                    \hrule width\linewidth height0pt
                    \columnbreak
            \else
                    \mcnewpage
            \fi
    }
    \makeatother
    \tablehead{Item \#&\\}
    \begin{supertabular}{lp{1.5in}}
    \tablebody
    \end{supertabular}
    \end{multicols*} 
    \end{document}
0

Your Answer

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

Browse other questions tagged or ask your own question.