1

enter image description here

How to fit in LaTex just like a long table more than one page? I need some help

  • 5
    Have a look at package longtable – Johannes_B Mar 12 '18 at 11:08
  • 1
    Longtable (as @Johannes_B already said) and maybe use landscape pages for the table, this will probably reduce the number of linebreaks in the very narrow columns. – user36296 Mar 12 '18 at 11:27
  • please also have a look at tex.stackexchange.com/questions/332902/… – user36296 Mar 12 '18 at 11:34
1

Have a look at the longtabu package, here is an example:

\documentclass[a4paper]{article}
\usepackage{tabu}
\usepackage{longtable}
\usepackage{booktabs}

\begin{document}
    \centering \footnotesize
    \begin{longtabu} to \linewidth {X[l .1] X[l .5] X[c .1] X[c .1] X[c .1]}
        \toprule
        \rowfont[c]{\bfseries}
        Number & Requirement & Relation & Value & Unit \\
        \midrule
        \endhead
        \bottomrule
        \multicolumn{5}{c}{\textsl{Continues on the next page}}
        \endfoot
        \bottomrule
        \endlastfoot
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
    \end{longtabu}

\end{document}

Which produces: enter image description here enter image description here enter image description here

  • 1
    apparently you admire tabu :-). however you should warn op, that this (otherwise powerful) package is not maintained anymore an is buggy. so it can happen, that in some circumstances will not work as expected. the very same solution you can obtain with longtable with p{,,,} column type or with ltablex with X column type. – Zarko Mar 12 '18 at 12:03
  • @Jack Good to hear it is working, can you select this is the correct answer? – Foitn Mar 12 '18 at 12:17
  • @Zarko Thank you for telling me, I've been using this environment for over a year now and I've had a couple of hiccups, so it might indeed be good to have a look into that. – Foitn Mar 12 '18 at 12:18
0

an alternative with use of ltablex package.

as support to columns' headers formatting is used packagemakecell. for more "professional" and oppen look is usedbooktabsfor rules in table where i suggest to replace all rules in table body with additional space provided by\addlinespace`.

further attention is given to formatting long text in cells. since their are narrow their formatting can be improved by use command RaggedRight from package ragged2e in definition of new column type L (see mwe below).

\documentclass[a4paper]{article}
\usepackage[margin=20mm]{geometry}
\usepackage{ragged2e}
\usepackage{booktabs, makecell, ltablex}
\renewcommand\theadfont{\small\bfseries}
\newcolumntype{L}{>{\RaggedRight}X}
%\keepXColumns  % used in cases when contents of all X columns
                % are shorter than their width which you like to preserve

\usepackage{lipsum}

\begin{document}
    \begingroup
\small
\sffamily
\setlength\tabcolsep{3pt}
\begin{tabularx}{\linewidth} {@{}c >{\hsize=0.7\hsize}L l l
                              *{3}{>{\hsize=1.1\hsize}L}
                              @{}}
    \toprule
\thead{Number}  & \thead{Risk}          & \thead{Likelihood}    & \thead{Severity}
                & \thead{Description}   & \thead{Effect on\\Project}
                                                                & \thead{Solution}\\
    \midrule
\endhead
    \midrule
\multicolumn{7}{r}{\textsl{Continues on the next page}}
\endfoot
    \bottomrule
\endlastfoot
1   & Poor schedule ability & Low           & Hight
    & \lipsum*[11]          & \lipsum*[11]  & \lipsum*[11]  \\
    \addlinespace
2   & Poor ability of using software such as Matlab
                            & Hight         & Hight
    & \lipsum*[11]          & \lipsum*[11]  & \lipsum*[11]  \\
    \addlinespace
3   & Complexity underestimated
                            & Low           & Medium
    & \lipsum*[11]          & \lipsum*[11]  & \lipsum*[11]  \\
1   & Poor schedule ability & Low           & Hight
    & \lipsum*[11]          & \lipsum*[11]  & \lipsum*[11]  \\
    \addlinespace
2   & Poor ability of using software such as Matlab
                            & Hight         & Hight
    & \lipsum*[11]          & \lipsum*[11]  & \lipsum*[11]  \\
    \addlinespace
3   & Complexity underestimated
                            & Low           & Medium
    & \lipsum*[11]          & \lipsum*[11]  & \lipsum*[11]  \\
\end{tabularx}
    \endgroup
\end{document}

top of the first page:

enter image description here

bottom of the first page and top of the second:

enter image description here

  • @Jack, please compare bot answer with your real data and than be so kind and inform me, why accepted answer better fulfill your expectation. I like to learn more about people expectations. – Zarko Mar 12 '18 at 13:19

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.