2

This question already has an answer here:

I have a pretty long table which is of the size of one page. The thing is that I want that this table is broken in pieces if my whole text is about to jump to the next page so that one part of the table is on the preceding page and one on the next page. This should happen dynamically, so that no each time I change something in the preceding text, I have to adjust the break-point of my table as well. Currently, I have the problem that my text stops a page before somewhere in the middle of the page and then there is like one half blank page and then at the next page, my table starts.

My table looks like this:

 \begin{table}[H]
   \begin{center}
   \begin{tabular}[H]{ | l |l | l | l |l|}
   \hline
    $D$ & $\text{C}$ &  $\text{ A } $ & $\text{ B } \mathscr{E}_{n_2(i)}$   & $\text{ E } $\\ \hline


4 & 1 &  -39.2857 & -39.2857 & -39.2857  \\ 
    4 & 2 & -28.2894 & -28.2894  & -28.2894 \\
    4 & 3 &   -18.2143& -18.2143 &   -18.2143  \\ 
    4 & 4 &    -9.2106 & -9.2105 &    -9.2106 \\  \hline

    5 & 0 &  -44.0681 & -44.0681 & -44.0681  \\ 
    5 & 1 &  -32.6119 & -32.6119  & -32.6119 \\ 
    5 & 2 &  -22.0150 & -22.0150 & -22.0150 \\ 
    5 & 3 &  -12.3881   & -12.3881 & -12.3881  \\ 
    5 & 4 &  -3.9169  & -3.9169 & -3.9161\\  \hline

    6 & 1 &  -48.8587 & -48.8587    &  -48.8587  \\ 
    6 & 2 &  -36.9628 & -36.9628    & -36.9628  \\ 
    6 & 3 &   -25.8760 & -25.8760   & -25.8760 \\ 
    6 & 4 &   -15.6840   & -15.6840 & -15.6840       \\ 
    6 & 5 &  -6.5153  & -6.5154  &  -6.5153\\ 
    6 & 6 &   1.3968  & 1.4012 & 1.3968\\  \hline

    7 & 0 & -53.6566 & -53.6566  & -53.6566\\ 
    7 & 1 & -41.3386 & -41.3386  & -41.3386 \\ 
    7 & 2 & -29.7877 & -29.7877  & -29.7877 \\ 
    7 & 3 & -19.0729   & -19.0729 &  -19.0729    \\ 
    7 & 4 & -9.2903  & -9.2903 & -9.2903 \\ 
    7 & 5 & -0.5885 & -0.5885 & -0.5887\\ 
    7 & 6 &  6.7346  & 6.7346  & 6.7540\\  \hline

    8 & 1 & -58.4610 & -58.4610 &-58.4610   \\ 
    8 & 2 & -45.7363 & -45.7363 & -45.7363  \\ 
    8 & 3 &  -33.7433 & -33.7433 & -33.7433 \\ 
    8 & 4 &  -22.5385   & -22.5385 & -22.5385      \\ 
    8 & 5 &  -12.1974  & -12.1974 & -12.1974 \\ 
    8 & 6 & -2.8272 & -2.8272 & -2.8272 \\ 
    8 & 7 &  5.4017  & 5.4004 & 5.4017\\ 
    8 & 8 &  12.1020  & 12.1687 & 12.1020\\ 
     \hline
    \end{tabular}
  \end{center}
   \end{table}

marked as duplicate by LaRiFaRi, Svend Tveskæg, Gonzalo Medina formatting Mar 3 '15 at 14:57

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Please also take a look on center vs. centering – LaRiFaRi Mar 3 '15 at 14:37
  • I assume you also load the float package, since you use the location specifier [H]. This specifier operates utterly by brute force, as you've discovered: if it can't place the float entirely on one page, an ugly gap is left on the remainder of the page. Try omitting the location specifier entirely or (at the very least) using [ht!] instead of [H]. That way, if the table doesn't fit on the current page, it'll "float" to the top of the following page, while LaTeX can fill up the remainder of the page with additional text (or other) material. – Mico Mar 3 '15 at 14:48
3

Use longtable

\documentclass{article}
\usepackage{lipsum}
\usepackage{mathrsfs,amsmath}
\usepackage{longtable}
\begin{document}
\lipsum[1-2]
   \begin{longtable}{ | l |l | l | l |l|}
   \hline
   $D$ & $\text{C}$ &  $\text{ A } $ & $\text{ B } \mathscr{E}_{n_2(i)}$   & $\text{ E } $\\ \hline
\endfirsthead
%
\multicolumn{5}{l}%
{{\bfseries \tablename\ \thetable\ Continued from previous page}} \\
\hline
%
$D$ & $\text{C}$ &  $\text{ A } $ & $\text{ B } \mathscr{E}_{n_2(i)}$   & $\text{ E } $\\ \hline
\endhead
%
\hline \multicolumn{5}{|r|}{{Continued on next page}} \\ \hline
\endfoot
%
\hline
\multicolumn{5}{|r|}{{Concluded}} \\ \hline
\endlastfoot

4 & 1 &  -39.2857 & -39.2857 & -39.2857  \\
    4 & 2 & -28.2894 & -28.2894  & -28.2894 \\
    4 & 3 &   -18.2143& -18.2143 &   -18.2143  \\
    4 & 4 &    -9.2106 & -9.2105 &    -9.2106 \\  \hline

    5 & 0 &  -44.0681 & -44.0681 & -44.0681  \\
    5 & 1 &  -32.6119 & -32.6119  & -32.6119 \\
    5 & 2 &  -22.0150 & -22.0150 & -22.0150 \\
    5 & 3 &  -12.3881   & -12.3881 & -12.3881  \\
    5 & 4 &  -3.9169  & -3.9169 & -3.9161\\  \hline

    6 & 1 &  -48.8587 & -48.8587    &  -48.8587  \\
    6 & 2 &  -36.9628 & -36.9628    & -36.9628  \\
    6 & 3 &   -25.8760 & -25.8760   & -25.8760 \\
    6 & 4 &   -15.6840   & -15.6840 & -15.6840       \\
    6 & 5 &  -6.5153  & -6.5154  &  -6.5153\\
    6 & 6 &   1.3968  & 1.4012 & 1.3968\\  \hline

    7 & 0 & -53.6566 & -53.6566  & -53.6566\\
    7 & 1 & -41.3386 & -41.3386  & -41.3386 \\
    7 & 2 & -29.7877 & -29.7877  & -29.7877 \\
    7 & 3 & -19.0729   & -19.0729 &  -19.0729    \\
    7 & 4 & -9.2903  & -9.2903 & -9.2903 \\
    7 & 5 & -0.5885 & -0.5885 & -0.5887\\
    7 & 6 &  6.7346  & 6.7346  & 6.7540\\  \hline

    8 & 1 & -58.4610 & -58.4610 &-58.4610   \\
    8 & 2 & -45.7363 & -45.7363 & -45.7363  \\
    8 & 3 &  -33.7433 & -33.7433 & -33.7433 \\
    8 & 4 &  -22.5385   & -22.5385 & -22.5385      \\
    8 & 5 &  -12.1974  & -12.1974 & -12.1974 \\
    8 & 6 & -2.8272 & -2.8272 & -2.8272 \\
    8 & 7 &  5.4017  & 5.4004 & 5.4017\\
    8 & 8 &  12.1020  & 12.1687 & 12.1020\\
     \hline
    \end{longtable}
\end{document}

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.