2

I would like to build a simple LaTeX table, something like a 3 columns x 4 rows table, as in figure (hand drew). The problem is that I cannot find anywhere a simple explanation about the code to insert to write things as I did by hand.

I mean, I know the tabular command, and all the codes to make a 3x4 table, but then I cannot find how to place text in multi lines and so on.

I would like something "big"!

enter image description here

1
  • You can use p-columns and use \newline inside a cell to get multiple lines – knut Oct 26 '15 at 22:09
2

In this case, you should use the tabularx environnement (need to use \usepackage{tabularx}). I only wrote one line of the table:

\begin{tabularx}{\linewidth}{|X|X|X|}
\hline
$\Delta < 0$ & No real roots always holds true! & No real roots never satisfied!  And you can add text if you want to see a break somewhere\\
\hline
\end{tabularx}
0
2

An example with 3 columns, each 0.3\textwidth (the last 0.1 text width can be used for the lines).

You get multiple lines with \newline

\documentclass{article}

\begin{document}
\begin{tabular}{|*{3}{p{0.3\textwidth}|}}\hline
a & b & c\\\hline
a & b1\newline b2 & c\\\hline
a & b & c\\\hline
\end{tabular}

\end{document}

The result:

Output result

Remark: Normally you should avoid the lines around the cells, see for example https://www.inf.ethz.ch/personal/markusp/teaching/guides/guide-tables.pdf

For the math, see also how to insert multi line equation in the tabular environment?

2

Given that most of the cells in the table have a very organized structure, it's probably not a good idea to employ automatic line breaking to render the cells' contents. Instead, I'd use nested tabular environments. (In the code below, I wasn't too sure about the symbol that occurs in two of the three header cells...)

enter image description here

\documentclass{article}
\usepackage{array}

\begin{document}
\begin{center}
\renewcommand\arraystretch{1.5}
\begin{tabular}{|>{$}c<{$}|c|c|}
\hline
Ax^2+Bx+C & $\mathop{>}_1^{} \ge 0$ & $\mathop{>}_1^{} \le 0$ \\
\hline
\Delta<0 & 
\renewcommand\arraystretch{1.15}
\begin{tabular}{@{}c@{}}
  \textsc{no real roots}\\
  always holds true!
\end{tabular} & 
\renewcommand\arraystretch{1.15}
\begin{tabular}{@{}c@{}} 
  \textsc{no real roots} \\
  \emph{never}  satisfied! \\
\end{tabular} \\
\hline
\Delta = 0 &
\renewcommand\arraystretch{1.15}
\begin{tabular}{@{}c@{}} 
  \textsc{2 coinc.\ solut.} \\
  $x_{1,2}\ge x_0$
\end{tabular} & 
\renewcommand\arraystretch{1.15}
\begin{tabular}{@{}c@{}} 
  \textsc{2 coinc.\ solut.} \\
  $x_{1,2}\le x_0$
\end{tabular} \\
\hline
\Delta>0 & 
\renewcommand\arraystretch{1.15}
\begin{tabular}{@{}c@{}} 
  \textsc{2 dist.\ solutions}\\
  $x_1\ge x_{\max}$\\
  $x_2\le x_{\min}$ 
\end{tabular} & 
\renewcommand\arraystretch{1.15}
\begin{tabular}{@{}c@{}} 
  \textsc{2 dist.\ roots}\\
  $x_{\min}\le x \le x_{\max}$\\
  \null  % blank 3rd line
\end{tabular} \\
\hline
\end{tabular}
\end{center}
\end{document} 
2
  • I thing taht the OP handwriting for second and third column meaning: $>, \;\ge 0$ and $<, \;\le 0$ ... :-). – Zarko Oct 27 '15 at 2:02
  • @Zarko - Thanks, good one! Let's see if the OP weighs in with his/her thoughts... :-) – Mico Oct 27 '15 at 5:20

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.