1

How can I proceed with LaTeX code such that to produce a table in which entire text to be showed normally. The photo is:

enter image description here

The code for last line is:

\hline 
VOLUMEN & $a^{3}$ & $\frac{\sqrt{2}}{12}\cdot a^{3}$ & $\frac{\sqrt{2}}{3}\cdot a^{3}$ & $\frac{\sqrt{15+ 7\sqrt{5}}}{4} \cdot a^{3}$ & $\frac{5 \sqrt{3+\sqrt{5}}}{12}\cdot a^{3}$ \\
\hline 
LaRiFaRi
  • 43,807
Iuli
  • 471

3 Answers3

3

I would recommend using the booktabs package as it makes your table better readable and fixes your problem automatically:

% arara: pdflatex

\documentclass{article}
\usepackage{booktabs}
\usepackage[spanish]{babel}

\begin{document}
\begin{tabular}{rlllll}
\toprule 
POLIERDRO & CUBO & TETRAEDRO & OCTAEDRO & DODECAEDRO & ICOSAEDRO\\
\midrule
... & ... & ... & ... & ... & ...\\
VERTICES & 8 & 4 & 6 & 20 & 12\\
ARTISTAS & 12 & 6 & 12 & 30 & 30\\
? & $6 \cdot a^2$ & $\sqrt{3} \cdot a^2$ & $2 \cdot \sqrt{3} \cdot a^2$ & ... & ...\\
VOLUMEN & $a^3$ & $\frac{\sqrt{2}}{12}b\cdot a^3$ & $\frac{\sqrt{2}}{3} \cdot a^3$ & $\frac{\sqrt{15+7\sqrt{5}}}{4} \cdot a^3$ & $\frac{5 \sqrt{3+\sqrt{5}}}{12} \cdot a^3$ \\
\bottomrule
\end{tabular}
\end{document}

enter image description here

If you prefer to stick with your version, you have to enlarge all heights or the height of one row as explained here.

A last possibility would be to reduce the height of your equations by using a slash-notation, a -1 exponent, decimal numbers, or packages like xfrac or nicefrac. The last two will write your fractions in slash-notation. Search this side for examples. I don't know, if these packages are still actual.

LaRiFaRi
  • 43,807
2

A solution using the makecell package (to multiline centred cells and heads), cellspace package, to have a minimal vertical spacing at the top and borromm of cells, and nccmath to have medium-sized fractions.

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage{array, makecell}
\renewcommand\theadfont{\rmfamily\bfseries}
\newcommand\multicolthead[3]{\multicolumn{#1}{#2}{\thead{#3}}}
\usepackage{cellspace}
\setlength\cellspacetoplimit{4pt}
\setlength\cellspacebottomlimit{4pt}
\usepackage{nccmath}

\begin{document}

\begin{table}[!ht]
\begin{tabular}{ |l|*{5}{Sc|} }
\hline
\thead*{POLIEDRO} &\thead{CUBO} & \thead{TETRAEDRO} & \thead{OCTAEDRO} & \thead{DODECAEDRO} & \thead{ICOSAEDRO} \\
\hline
CARAS & 6 cuadrados & \makecell*{4 triangulos \\equilateros} & \makecell{8 triangulos \\equilateros} & \makecell{12 pentagonos \\ regulares} & \makecell{20 triangulos \\ equilateros} \\
\hline
VERTICES &8 & 4 & 6 & 20 & 12 \\
\hline
ARISTAS & 12 & 6 & 12 & 30 & 30 \\
\hline
????? & $ 6a² $ &$ \sqrt{3}a² $ & $ 2\sqrt{3}a² $ & $ 3\sqrt{25 + 10\sqrt{5}}a² $ & $ 5\sqrt{3}a² $ \\
\hline
VOLUMEN& $a^{3}$ & $\mfrac{\sqrt{2}}{12}\cdot a^{3}$ & $ \mfrac{\sqrt{2}}{3}\cdot a^{3}$ & $\mfrac{\sqrt{15+ 7\sqrt{5}}}{4} \cdot a^{3}$ & $\frac{5 \sqrt{3+\sqrt{5}}}{12}\cdot a^{3}$ \\
\hline
\end{tabular}
\end{table}

\end{document} 

enter image description here

Bernard
  • 271,350
0

You can use \def\arraystretch{1.5} before your tabular environment to extend the height of the rows in a table. The factor in the parentheses adjusts the relative height of the rows whereas a value of 1 (or 1.0) is default.

A good place to have it is right behind the \begin{table}. That way you can make shure it holds only for this particular table and not for all tables to come. Or ouy can use \bgroup and \egroup, respectively, to make it local.

Lupino
  • 2,772