This is my first question here. I read many topics, but none have solved my problem.
I need to split a table (using longtable
or other) with the tabularx
settings. I tried ltablex
, but this changed all the other tables in the text. I also tried LTXtable
, but I guess I did not know how to use it properly.
Below is the code and appearance using tabularx
, as I want it to stay using longtable.
\documentclass{article}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{array}
\usepackage{float}
\begin{document}
\begin{table}[H]
\centering
\small
\caption{Planejamento experimental.}
\label{tab:MatrizPlanExp}
\newcolumntype{C}{>{\centering\arraybackslash\hsize=1\hsize}X}
\renewcommand{\arraystretch}{1.15} % Espaçamento
\begin{tabularx}{\textwidth}{CCC}
\toprule
\textbf{Experimento nº} & \textbf{Temperatura (°C)} & \textbf{WHSV (h$^{-1}$)} \\
\midrule
1 & 240 & 40 \\
2 & 240 & 45 \\
3 & 240 & 50 \\
4 & 240 & 55 \\
5 & 240 & 60 \\
6 & 260 & 40 \\
7 & 260 & 45 \\
8 & 260 & 50 \\
9 & 260 & 55 \\
10 & 260 & 60 \\
11 & 280 & 40 \\
12 & 280 & 45 \\
13 & 280 & 50 \\
14 & 280 & 50 \\
15 & 280 & 50 \\
16 & 280 & 55 \\
17 & 280 & 60 \\
18 & 300 & 5 \\
19 & 300 & 10 \\
20 & 300 & 20 \\
21 & 320 & 2,5 \\
22 & 320 & 5 \\
23 & 320 & 10 \\
24 & 320 & 20 \\
25 & 340 & 2,5 \\
26 & 340 & 5 \\
27 & 340 & 10 \\
28 & 340 & 20 \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}
Here is the best I got using longtable
(I have increased the lines to go to the other page).
\begin{document}
\begin{longtable}{@{}P{4cm}P{4cm}P{4cm}@{}}
\caption{Planejamento experimental.}\\
\toprule
\textbf{Experimento nº} & \textbf{Temperatura (°C)} & \textbf{WHSV (h$^{-1}$)} \\
\midrule
1 & 240 & 40 \\
2 & 240 & 45 \\
3 & 240 & 50 \\
4 & 240 & 55 \\
5 & 240 & 60 \\
6 & 260 & 40 \\
7 & 260 & 45 \\
8 & 260 & 50 \\
9 & 260 & 55 \\
10 & 260 & 60 \\
11 & 280 & 40 \\
12 & 280 & 45 \\
13 & 280 & 50 \\
14 & 280 & 50 \\
15 & 280 & 50 \\
16 & 280 & 55 \\
17 & 280 & 60 \\
18 & 300 & 5 \\
19 & 300 & 10 \\
20 & 300 & 20 \\
21 & 320 & 2,5 \\
22 & 320 & 5 \\
23 & 320 & 10 \\
24 & 320 & 20 \\
25 & 340 & 2,5 \\
26 & 340 & 5 \\
27 & 340 & 10 \\
28 & 340 & 20 \\
19 & 300 & 10 \\
20 & 300 & 20 \\
21 & 320 & 2,5 \\
22 & 320 & 5 \\
23 & 320 & 10 \\
24 & 320 & 20 \\
25 & 340 & 2,5 \\
26 & 340 & 5 \\
27 & 340 & 10 \\
28 & 340 & 20 \\
20 & 300 & 20 \\
21 & 320 & 2,5 \\
22 & 320 & 5 \\
23 & 320 & 10 \\
24 & 320 & 20 \\
25 & 340 & 2,5 \\
26 & 340 & 5 \\
27 & 340 & 10 \\
\bottomrule
\label{tab:MatrizPlanExp}\\
\end{longtable}
\end{document}
I would like to:
1) Use \small
font with longtable
without decreasing the font of the caption.
2) Have a row closing and starting the split table.
3) Write on the dividing page that the table continues on the next page, or something like that.
Please, help me.
table
wrapper, right? You can't have a float split across pages, so you need to get rid of that.