Consecutive tables in LaTeX

Wondering how to place multiple tables sequentially in LaTeX?

The page with text right in front of the first table has little space, but not enough space for the first table, so the first table should be placed at the top of the next page, although I'm using for it \begin{table}[!h]

.

The second table doesn't fit in the rest of the first table's page, so I think I could use a longtable for it to cover the rest of the page and the top of the next page. Likewise, I am using longtable for the third table.

The LaTeX code looks like this:

... % some text  

\begin{table}[!h]  
\caption{Table 1. \label{tab:1}}  
\begin{center}  
\begin{tabular}{c c}  
...  
\end{tabular}  
\end{center}  
\end{table}     

\begin{center}  
\begin{longtable}{ c c }  
\caption{Table 2. \label{tab:2}}\\   
...  
\end{longtable}  
\end{center}  

\begin{center}  
\begin{longtable}{ c c }  
\caption{Table 3. \label{tab:3}}\\   
...  
\end{longtable}  
\end{center}  

... % some text

      

In the compiled pdf file, it turns out that the order of the tables is messed up. The first table is placed after the second and third, and the second - a page with text in front of the tables and the next page with the third following it.

I would like to know how can I make three tables appear sequentially in order and there is no space between the text and the tables?

Or, if I hope this is not possible, what is the best strategy?


EDIT:

Removing [! h] hasn't improved, the first table is behind the second and third.


EDIT:

As suggested by one of the following answers, using [H] works for me. Out of curiosity, what is the difference between the [H] and [! H]?

+2


a source to share


2 answers


I forgot it is an array or float package that gives you [H], but this always worked for me:



\begin{table}[H]
...
\end{table}

      

+1


a source


Try to remove [!h]

The point is what \begin{table} ... \end{table}

defines a floating insert. This insert appears on one of the following pages. \begin{longtable}

defines a non-fusible table. Longtable appears immediately.



You need to delete \begin{table} ... \end{table}

so that the first table appears immediately. [!h]

does not make the table non-floating.

+3


a source







All Articles