2

I would like to create a table like this, but the first row is too long and exceeded the width of page. How can I create and fix this problem in latex? enter image description here

1
  • Assuming your 3 columns all are l (or c or r), you probably want either the p / m / b paragraph-like styles for the last one or a flexible-width one like X. The latter is often combined with fixed-width tabulars. Read up on the tabularx, tabu and ctable packages. Similar questions must have been asked here dozens of times. Also, show your code next time!
    – Crissov
    Feb 12 '14 at 9:53
2

The simplest to start is use of tabular with multirow. Here the third column expands up to 0.8\textwidth.

enter image description here

Code

\documentclass[border=10pt]{standalone}
\usepackage{multirow,array,lipsum}

\begin{document}
\newcolumntype{M}{>{\raggedright\arraybackslash}m{0.8\textwidth}}


\begin{tabular}{cc|M}\hline
\multirow{3}{*}{x} & $x_1$&\lipsum[1]\\
                   & $x_2$&xxxxxxxxxxxxxx\\
                   & $x_3$& xxxxxxxxxxxxxx\\                    
\end{tabular}

\end{document}
1

Try to reduce space between all cols(\setlength{\tabcolsep}{0.1 cm}):

\begin{center}
\setlength{\tabcolsep}{0.1 cm}
\begin{tabular}{cc|cccccccccc}
  \hline
  x & x & x & x & x & x & x & x & x & x & x & x & x & x\\
  %...
\end{tabular}
\end{center}

or set hspace in tabular

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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