## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Tabulars float to next page

Information and discussion about graphics, figures & tables in LaTeX documents.
Notis
Posts: 4
Joined: Wed Nov 18, 2015 2:00 am

### Tabulars float to next page

Hi all,

I'm working on a piece containing a series of sequential tables. Currently, if a table is going to run between pages it is floated to a new page.When one table ends, I want the next to begin, even if it has to run onto the next page.

Below is a an example. In my preferred scenario, the C | D column would start on the first page.

-Nick

\documentclass[11pt]{article}\begin{document}  \begin{tabular}{ll}	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\ \end{tabular}	 \begin{tabular}{ll}	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\\end{tabular}	  \end{document}
Last edited by Notis on Wed Nov 18, 2015 9:26 pm, edited 1 time in total.

Johannes_B
Site Moderator
Posts: 3853
Joined: Thu Nov 01, 2012 4:08 pm
Welcome,

a tabular is a single box and LaTeX places it as such. The second tabular didn't fit the page and was pushed to the next. Exactly that is the reason, why floating environments like table where introduced.

Tables, that are longer than one page are usually split using package longtable:
\documentclass[11pt]{article}\usepackage{longtable}\begin{document}  \begin{tabular}{ll}	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\	A & B \\ \end{tabular}   \begin{longtable}{ll}	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\	C & D \\\end{longtable}    \end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Notis
Posts: 4
Joined: Wed Nov 18, 2015 2:00 am
Thanks for the suggestions, Johannes. longtable does seem to work with the MWE I initially posted. However, the tabular I'm actually working with is a little more complex, containing set column widths following a section title. Below is a marginally more sophisticated MWE. Within this example, I am no longer to use longtable in the way I could have in my previous example.
Any advice as to how I could use longtable with these restrictions would be appreciated.
-Nick

\documentclass[11pt]{article}\usepackage{array}\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}\newcolumntype{C}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \begin{document} \begin{tabular}{L{2cm}  C{13cm}}			\vspace{5pt}		NUMBERS & \textbf Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\			\vspace{5pt}		NUMBERS & \textbf Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\			\vspace{5pt}		NUMBERS & \textbf Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\			\vspace{5pt}		NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\			\vspace{5pt}			NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\			NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\			\vspace{5pt}		NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\			\vspace{5pt}		NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\			\vspace{5pt}		NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\			\vspace{5pt}			NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\			NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\	 \end{tabular} \begin{tabular}{L{2cm}  C{13cm}}		\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\		\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\		\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\		\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\		\vspace{5pt}		NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\		NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\		\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\		\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\		\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\		\vspace{5pt}		NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\		NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\		\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\		\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\	\end{tabular}  \end{document}

Johannes_B
Site Moderator
Posts: 3853
Joined: Thu Nov 01, 2012 4:08 pm
What isn't working? Right now, the tabular is just too wide for the default margin settings of article. Making the second column narrower, i don't see any problem.
\documentclass[11pt]{article}\usepackage{longtable}\usepackage{array}\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}\newcolumntype{C}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \begin{document} \begin{longtable}{L{2cm}  C{9cm}}       	\vspace{5pt}	NUMBERS & \textbf Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\       	\vspace{5pt}	NUMBERS & \textbf Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\       	\vspace{5pt}	NUMBERS & \textbf Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\       	\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      	\vspace{5pt}   	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      	\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      	\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      	\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      	\vspace{5pt}   	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\       \end{longtable} \begin{longtable}{L{2cm}  C{9cm}}       	\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      	\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      	\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      	\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      	\vspace{5pt}   	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      	\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      	\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      	\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      	\vspace{5pt}   	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      	\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      	\vspace{5pt}	NUMBERS &  Lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots and lots of text \\      \end{longtable}\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.