Graphics, Figures & TablesHow to manage a large texte table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
NELLLY
Posts: 113
Joined: Thu Nov 26, 2009 2:21 am

How to manage a large texte table

Post by NELLLY »

Hello
I have a large table containing text in its contents and in the clolumn labels. when I use the following code the table exceed the width of the page.

Code: Select all

\documentclass{report}
\usepackage{geometry}
\geometry{
  text={6in,8.9in},
  headsep=.4in,
  footnotesep=.2in
}

\begin{document}
\begin{table}[t]
\caption{Table .....}
\begin{tabular}{lllllll}
~~&author 1 (year)& author 2 (year) & author 3 (year)& author 4 (year)& author 5(year)&author6(year)\\
Type of the chart&texte...&texte...&texte...&texte...&texte....&texte...\\
\end{tabular}
\end{table}



\end{document}


Is ther a solution?
Thanks.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

NELLLY
Posts: 113
Joined: Thu Nov 26, 2009 2:21 am

How to manage a large texte table

Post by NELLLY »

Hello
I made this temporary solution

Code: Select all

\documentclass{report}
\usepackage{geometry,tabularx,booktabs}
\usepackage{geometry}
\geometry{
  text={6in,8.9in},
  headsep=.4in,
  footnotesep=.2in
}
\begin{document}
\begin{table}[t]
\caption{Table .....}
\begin{scriptsize}
\begin{tabularx}{\textwidth}{p{4cm}llllll} \toprule[1.2pt]
  &\textbf{AAAAAAA} & \textbf{BBBBBBB} & \textbf{AAAAAAAAA}&\textbf{AAAAAAAAAA et al. 4} &  \textbf{AAAAA and BBBBBBB} &\textbf{KKKKK and LLLLL}\\
  &\textbf{(1994)}     &  \textbf{(1992)}      &  \textbf{(1995)}   & \textbf{(2001)}  &   \textbf{(2010)}&\textbf{(2014)}\\ \midrule[1.2pt]
\textbf{Type of the chart}&texte...&texte...&texte...&texte...&texte....&texte...\\\\
\textbf{Values of process and cost parameters} &....&....&....&....&....&.....\\\\
\textbf{Expected cost savings}&....&...&...&...&...&...\\\bottomrule[1.2pt]
\end{tabularx}
\end{scriptsize}
\end{table}
\end{document}


Is there an other solution? What can I do to make it more pretty.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

How to manage a large texte table

Post by Johannes_B »

You could set the table in landscape mode, still it won't fit and you have to change the font size (please be aware, that font switches are commands, no environments).

Code: Select all

\documentclass{report}
\usepackage{geometry,tabularx,booktabs}
\usepackage{geometry}
\geometry{
	text={6in,8.9in},
	headsep=.4in,
	footnotesep=.2in
}
\newcommand{\tablehighlight}[1]{\textbf{#1}}
\usepackage{rotating}
\begin{document}
\begin{sidewaystable}
	\caption{Table .....}
%	\begin{scriptsize}
	\scriptsize
		\begin{tabularx}{\textwidth}{p{4cm}llllll} \toprule[1.2pt]
			&\tablehighlight{AAAAAAA} & \tablehighlight{BBBBBBB} & \tablehighlight{AAAAAAAAA}&\tablehighlight{AAAAAAAAAA et al. 4} &  \tablehighlight{AAAAA and BBBBBBB} &\tablehighlight{KKKKK and LLLLL}\\
			&\tablehighlight{(1994)}     &  \tablehighlight{(1992)}      &  \tablehighlight{(1995)}   & \tablehighlight{(2001)}  &   \tablehighlight{(2010)}&\tablehighlight{(2014)}\\ \midrule[1.2pt]
			\tablehighlight{Type of the chart}&texte...&texte...&texte...&texte...&texte....&texte...\\\\
			\tablehighlight{Values of process and cost parameters} &....&....&....&....&....&.....\\\\
			\tablehighlight{Expected cost savings}&....&...&...&...&...&...\\\bottomrule[1.2pt]
		\end{tabularx}
%	\end{scriptsize}
\end{sidewaystable}
\end{document}
It seems to me, that it would be better to simply transpose the material, i.e. a new line for every cited author/article.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply