0

I'm trying to draw the table of the image, but I can not find the way to do it with latex.

tabla

\begin{tabular}{|C{1cm}|C{1cm}|C{1cm}|C{1cm}|C{1cm}|C{1cm}|C{1cm}}
    \hline
    Tipo RA & \multicolumn{2}{c|}{Area [m$^2$]}& \multicolumn{2}{c|}{Volumen Semiesferico truncado}  \\

    1 &&&&&&\\ \hline
    2 &&&&&&\\ \hline
    3  &&&&&&\\ \hline
    4  &&&&&&\\ \hline
    5  &&&&&&\\ \hline
    6  &&&&&&\\   \hline     
    7  &&&&&&\\ \hline
\end{tabular}
Werner
  • 14,324
  • 7
  • 55
  • 77
robintux
  • 93
  • 1
  • 9

3 Answers3

4

I'd suggest using booktabs:

enter image description here

\documentclass{article}

\usepackage{booktabs,siunitx,makecell}
\newcommand{\pz}{\phantom{0}}
\sisetup{
  group-minimum-digits = 3
}

\begin{document}

\noindent
\begin{tabular}{ l *{6}{c} }
  \toprule
  & \multicolumn{4}{c}{Area [$m^2$]} & \\
  \cmidrule{2-5}
  & \multicolumn{2}{c}{Circular} & \multicolumn{2}{c}{El\'{\i}ptica} & 
    \multicolumn{2}{c}{\smash{\makecell[cb]{Volumen Semiesf\'erico \\ truncado [$m^3$]}}} \\
  \cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7}
  Tipo RA & Rango & Promedio & Rango & Promedio & Rango & Promedio \\
  \midrule
  ALTA  &    \num{20866}--\num{28983} & \num{24446} &   \num{13354}--\num{18549} & \num{15645} &   \num{589840}--\num{1201636} & \num{883786} \\
  MEDIA &    \num{16634}--\num{27254} & \num{20241} &   \num{12476}--\num{20440} & \num{15180} &   \num{539605}--\num{1131633} & \num{730582} \\
  BAJA  &  \pz\num{3822}--\num{25577} & \num{16097} & \pz\num{3407}--\num{22735} & \num{14307} & \pz\num{75664}--\num{1063784} & \num{647366} \\
  \bottomrule
\end{tabular}

\end{document}

In general, there is no need for vertical rules in a tabular, as the columnar display of information supports horizontal separation naturally.

Werner
  • 14,324
  • 7
  • 55
  • 77
1

Creating tables directly in LaTeX is not an easy task, I suggest you use tools that allow you to create tables for latex online such as: https://www.tablesgenerator.com/ Please add the following required packages to your document preamble:

\usepackage{multirow,multicol, makecell, booktabs}

\begin{tabular}{*{7}{c}}
\toprule
& \multicolumn{4}{c}{\smash{\makecell[c]{Area [$m^2$]}}}
& \multicolumn{2}{c}{\smash{\makecell[c]{Volumen Semiesférico \\ truncado [$m^3$]}}}\\
\cline{2-5}
& \multicolumn{2}{c}{Circular} & \multicolumn{2}{c}{Eliptica} & \\
\cline{2-7}
Tipo RA & Rango & Promedio & Rango & Promedio & Rango & Promedio \\
\midrule
ALTA  & 20866-28983 & 24464 & 20866-28983 & 24464 & 20866-28983 & 24464 \\
MEDIA & 20866-28983 & 24464 & 20866-28983 & 24464 & 20866-28983 & 24464 \\
BAJA  & 20866-28983 & 24464 & 20866-28983 & 24464 & 20866-28983 & 24464 \\
\bottomrule
\end{tabular}
rral
  • 554
  • 3
  • 20
  • 1
    Yes, the LaTeX code that has been converted or generated is 100% of times redundant, so edit the code accordingly to the second comment by @samcarter for example. When I was working in a scientific publishing house I was removing multicolumns and braces 3-5 times a week ;) – MattAllegro Jul 24 '19 at 07:50
0

Just a no-booktabs sketch, to reproduce your table as similar as possible. Using booktabs is of course recommended for a readability concept that holds everywhere but the first sight on the table would then change very much.

\documentclass{article}
\usepackage{multirow}

\begin{document}
Text

\begin{table}[ht]
{\sffamily%
\begin{tabular}{*{7}{c|}}
% be careful when nesting \multicolumn and \multirow
\cline{2-7}
\multirow{2}{*}{ } & \multicolumn{4}{|c|}{Area [$m^2$]} & \multicolumn{2}{c|}{\multirow{2}{*}{\shortstack[c]{Volumen Semiesf\'erico\\ truncado [$m^3$]}}}\\
\cline{2-5}
 & \multicolumn{2}{c|}{Circular} & \multicolumn{2}{c|}{El\'{\i}ptica} & \multicolumn{1}{c}{} & \\
% second part below is standard
\hline
\multicolumn{1}{|c|}{Tipo RA} & Rango & Promedio & Rango & Promedio & Rango & Promedio\\
\hline
\multicolumn{1}{|c|}{ALTA} & 2 - 2 & 3 & 4 - 4 & 5 & 6 - 6 & 7\\
\hline
\multicolumn{1}{|c|}{MEDIA} & 2 - 2 & 3 & 4 - 4 & 5 & 6 - 6 & 7\\
\hline
\multicolumn{1}{|c|}{BAJA} & 2 - 2 & 3 & 4 - 4 & 5 & 6 - 6 & 7\\
\hline
\end{tabular}
}%
\end{table}

Text.
\end{document}

The output of this code is:

screenshot of output

Alignments, line breaks and spacing may be considerably improved, also depending on your time and objectives.

MattAllegro
  • 6,455
  • 5
  • 45
  • 52