0

I am generating Latex file which contains tables and now I am looking for best multi-page table enviroment. I found longtabu environment which looks good but I have a few problems with it.

For example, I have a code like this:

\documentclass[11pt]{article}
\usepackage{tabu, booktabs, ltablex} 

\begin{document}
    \begin{longtabu} {|X[c]|X[c]|X[c]|}
        \hline 
        \rowfont{\bfseries}
        First & Second & Third \\
        \hline
        akjdsnakjsdnasd & aosidjaosidjoasdasasdasd & asdasd\\
        akjdsnakjsdnasd & aosidjaosidjoasdasasdasd & asdasd\\
        akjdsnakjsdnasd & aosidjaosidjoasdasasdasd & asdasd\\
        \hline
    \end{longtabu}
\end{document} 

Output is

rendered code

Text of the first and the last column has smaller width than the second one. Is it possible to consider this while using X[c] and render correct table?

Something like this but using X[c], not only c.

correct output

My code is generated so I can't set the width manually. Do you have any ideas how to do it? Thanks.

  • normally you need single line entries c 9which have the natural width of the text) or columns that allow linebreaking (which break to a specified width, even if no text is there) the tabulary package/environment does make an attempt to choose a width depending on the amount of text in the column, although doesn't break over pages without a bit of work – David Carlisle Nov 13 '15 at 19:06
  • with tabu you can add the -1 option to not have the width set, try X[-1,c] – ArTourter Nov 13 '15 at 19:36
  • related http://tex.stackexchange.com/questions/78075/multi-page-with-tabulary – touhami Nov 13 '15 at 20:09
  • I would not use tabu any more. Take longtable and array, so you can spefify columnwidth... – Peter Ebelsberger Nov 13 '15 at 22:32

0 Answers0