I want to do something like this:
It has two headings: the upper one I'm done with but now I want to add a lower heading for only some columns.
Is there a way to add such a heading in latex?
My attempt:
\begin{tabular}{lcccccccc}\hline \hline
& Whole world & Base sample & Whole world & Base sample & Whole world & Base sample & Whole world & Base sample \\
& (1) & (2) & (3) & (4) & (5) & (6) & (7) & (8) \\ \hline \\
& & & & & & & & & \\
\multicolumn{6}{c}{Dependent variable is log GDP per capita in 1995 } \\
& & & & & & & & \\
The following uses the eqparbox package to set the integer and decimal part of each number wrapped inside a \fmtnum
\documentclass{article}
\usepackage{booktabs,makecell,eqparbox}
\newcommand{\mc}{\multicolumn{1}{c}}
\makeatletter
\newcommand{\fmtnum}[1]{\#fmtnum#1\relax}
\def\#fmtnum#1.#2\relax{\eqmakebox[int][r]{$#1.$}\eqmakebox[dec][l]{$#2$}}
\makeatother
\begin{document}
\noindent
\begin{tabular}{ *{8}{c} }
\toprule
\makecell{Whole \\ world \\ (1)} &
\makecell{Base \\ sample \\ (2)} &
\makecell{Whole \\ world \\ (3)} &
\makecell{Base \\ sample \\ (4)} &
\makecell{Whole \\ world \\ (5)} &
\makecell{Base \\ sample \\ (6)} &
\makecell{Whole \\ world \\ (7)} &
\makecell{Base \\ sample \\ (8)} \\
\midrule
\multicolumn{6}{c}{\small Dependent variable is log GDP per capita in 1995} &
\multicolumn{2}{c}{\small \makecell[b]{Dependent variable \\ is log output per \\ worker in 1998}} \\
\cmidrule(lr){1-6}\cmidrule{7-8}
\fmtnum{ 0.54 } & \fmtnum{ 0.52 } & \fmtnum{ 0.47 } & \fmtnum{ 0.43 } & \fmtnum{ 0.47 } & \fmtnum{ 0.41 } & \fmtnum{ 0.45 } & \fmtnum{ 0.46 } \\
\fmtnum{(0.04)} & \fmtnum{(0.06)} & \fmtnum{(0.06)} & \fmtnum{(0.05)} & \fmtnum{(0.06)} & \fmtnum{(0.06)} & \fmtnum{(0.04)} & \fmtnum{(0.06)} \\
\addlinespace
& & \fmtnum{ 0.89 } & \fmtnum{ 0.37 } & \fmtnum{ 1.60 } & \fmtnum{ 0.92 } \\
& & \fmtnum{(0.49)} & \fmtnum{(0.51)} & \fmtnum{(0.70)} & \fmtnum{(0.63)} \\
& & & \fmtnum{-0.62 } & & \fmtnum{-0.60 } \\
& & & \fmtnum{(0.19)} & & \fmtnum{(0.23)} \\
& & & \fmtnum{-1.00 } & & \fmtnum{-0.90 } \\
& & & \fmtnum{(0.15)} & & \fmtnum{(0.17)} \\
& & & \fmtnum{-0.25 } & & \fmtnum{-0.04 } \\
& & & \fmtnum{(0.20)} & & \fmtnum{(0.32)} \\
\fmtnum{ 0.62 } & \fmtnum{ 0.54 } & \fmtnum{ 0.63 } & \fmtnum{ 0.73 } & \fmtnum{ 0.56 } & \fmtnum{ 0.69 } & \fmtnum{ 0.55 } & \fmtnum{ 0.49 } \\
\mc{110} & \mc{64} & \mc{110} & \mc{110} & \mc{64} & \mc{64} & \mc{108} & \mc{61} \\
\bottomrule
\end{tabular}
\end{document}
While it is a bit cumbersome, there is very little uniformity across the table, with mixtures of decimal values using parentheses and negative numbers, numbers without decimal parts and also headers that are wider than their column constituents (columns 7-8).
The above code requires at least 2 compilations with every change in the maximum width of a number's integer or decimal part.
You can streamline the input a little using collcell:
\documentclass{article}
\usepackage{booktabs,makecell,eqparbox,collcell}
\newcommand{\mc}{\multicolumn{1}{c}}
\makeatletter
\newcommand{\fmtnum}[1]{\if\relax\detokenize{#1}\relax\else\#fmtnum#1\relax\fi}
\def\#fmtnum#1.#2\relax{\eqmakebox[int][r]{$#1.$}\eqmakebox[dec][l]{$#2$}}
\makeatother
\begin{document}
\noindent
\begin{tabular}{ *{8}{>{\collectcell\fmtnum}c<{\endcollectcell}} }
\toprule
\mc{\makecell{Whole \\ world \\ (1)}} &
\mc{\makecell{Base \\ sample \\ (2)}} &
\mc{\makecell{Whole \\ world \\ (3)}} &
\mc{\makecell{Base \\ sample \\ (4)}} &
\mc{\makecell{Whole \\ world \\ (5)}} &
\mc{\makecell{Base \\ sample \\ (6)}} &
\mc{\makecell{Whole \\ world \\ (7)}} &
\mc{\makecell{Base \\ sample \\ (8)}} \\
\midrule
\multicolumn{6}{c}{\small Dependent variable is log GDP per capita in 1995} &
\multicolumn{2}{c}{\small \makecell[b]{Dependent variable \\ is log output per \\ worker in 1998}} \\
\cmidrule(lr){1-6}\cmidrule{7-8}
0.54 & 0.52 & 0.47 & 0.43 & 0.47 & 0.41 & 0.45 & 0.46 \\
(0.04) & (0.06) & (0.06) & (0.05) & (0.06) & (0.06) & (0.04) & (0.06) \\
\addlinespace
& & 0.89 & 0.37 & 1.60 & 0.92 \\
& & (0.49) & (0.51) & (0.70) & (0.63) \\
& & & -0.62 & & -0.60 \\
& & & (0.19) & & (0.23) \\
& & & -1.00 & & -0.90 \\
& & & (0.15) & & (0.17) \\
& & & -0.25 & & -0.04 \\
& & & (0.20) & & (0.32) \\
0.62 & 0.54 & 0.63 & 0.73 & 0.56 & 0.69 & 0.55 & 0.49 \\
\mc{110} & \mc{64} & \mc{110} & \mc{110} & \mc{64} & \mc{64} & \mc{108} & \mc{61} \\
\bottomrule
\end{tabular}
\end{document}
Related
I have a table that I would like to split over pages, but I can't seem to figure out how I can do it with my current lay-out or commands that I use.
At this time, I used landscape and minipage so that it would fit on one page:
\documentclass[11pt]{article}
\usepackage{pdflscape}
\usepackage{longtable}
\usepackage{lipsum}
\usepackage{bm}
\usepackage{makecell}
\begin{document}
\begin{landscape}
\centering
\begin{table}[!htb]
\caption{\label{CH2_tab:P80L} Empirical power from the simulation study with the indicators having an overall reliability of 80\% and a linear relationship with the latent variable. The highest power per setting is indicated in bold.}
\renewcommand{\arraystretch}{1.5}
\begin{minipage}{.5\linewidth}
\centering
\medskip
\scalebox{0.45}{
\begin{tabular}{rcccccc}
\hline
& \multicolumn{6}{c}{\textbf{Linear}} \\
\cline{2-7}
& \makecell{\textbf{WMW -- max rel} } & \makecell{\textbf{WMW -- mean }} & \makecell{\textbf{\textit{t} test -- max rel }} & \makecell{\textbf{\textit{t} test -- mean }} & \makecell{\textbf{SEM} } & \makecell{\textbf{SEM -- corrected}} \\
\hline
\multicolumn{7}{l}{$\mathcal{N}(0,1)$} \\
\multicolumn{7}{l}{\bm{$m=n=15$}} \\
\hline
Setting 1 & 29.7 & 31.0 & \textbf{33.2} & 32.9 & 32.4 & 32.1 \\
Setting 2 & 28.4 & 29.2 & 30.7 & \textbf{31.3} & 30.0 & 30.3 \\
Setting 3 & 29.5 & 29.3 & 31.8 & \textbf{32.3} & 32.0 & 31.9 \\
Setting 4 & 25.8 & 26.2 & 28.5 & 27.4 & \textbf{29.4} & 28.6 \\
\hline
\multicolumn{7}{l}{\bm{$m=n=50$}} \\
\hline
Setting 1 & 78.7 & 79.1 & 81.7 & 81.4 & \textbf{83.2} & 83.1 \\
Setting 2 & 79.5 & 78.8 & 81.0 & 80.4 & 82.0 & \textbf{82.1} \\
Setting 3 & 79.2 & 79.9 & 81.2 & 81.8 & \textbf{82.2} & 82.0 \\
Setting 4 & 74.8 & 72.3 & 77.6 & 74.4 & \textbf{80.0} & \textbf{80.0} \\
\hline
\multicolumn{7}{l}{\bm{$m=n=100$}} \\
\hline
Setting 1 & 98.2 & 98.1 & 98.5 & 98.6 & \textbf{98.7} & \textbf{98.7} \\
Setting 2 & 97.7 & 97.7 & 98.2 & \textbf{98.3} & \textbf{98.3} & \textbf{98.3} \\
Setting 3 & 97.6 & 97.5 & 98.1 & \textbf{98.2} & \textbf{98.2} & \textbf{98.2} \\
Setting 4 & 97.4 & 95.1 & 98.1 & 95.8 & 98.1 & \textbf{98.2} \\
\hline
\multicolumn{7}{l}{$t_5$} \\
\multicolumn{7}{l}{\bm{$m=n=15$}} \\
\hline
Setting 1 & 23.5 & 23.9 & 24.2 & 24.1 & \textbf{24.4} & 23.9 \\
Setting 2 & 24.0 & \textbf{24.1} & 23.1 & 22.6 & 22.0 & 22.2 \\
Setting 3 & 23.7 & \textbf{23.8} & 22.4 & 23.1 & 22.5 & 23.3 \\
Setting 4 & 22.1 & 22.4 & 22.2 & 22.4 & 22.4 & \textbf{23.5} \\
\hline
\multicolumn{7}{l}{\bm{$m=n=50$}} \\
\hline
Setting 1 & 65.8 & \textbf{66.1} & 60.8 & 60.9 & 61.8 & 61.4 \\
Setting 2 & \textbf{68.7} & \textbf{68.7} & 62.2 & 62.2 & 63.7 & 63.4 \\
Setting 3 & 67.3 & \textbf{67.6} & 61.1 & 61.4 & 62.7 & 62.2 \\
Setting 4 & \textbf{63.9} & 58.4 & 57.6 & 53.7 & 60.2 & 60.0 \\
\hline
\multicolumn{7}{l}{\bm{$m=n=100$}} \\
\hline
Setting 1 & 92.3 & \textbf{92.4} & 87.6 & 87.6 & 88.0 & 88.1 \\
Setting 2 & \textbf{91.7} & \textbf{91.7} & 87.0 & 87.4 & 87.9 & 87.8 \\
Setting 3 & 93.2 & \textbf{93.4} & 88.9 & 88.7 & 89.4 & 89.5 \\
Setting 4 & \textbf{90.6} & 86.8 & 85.7 & 83.4 & 87.4 & 87.4 \\
\hline
\hline
\end{tabular}
}
\end{minipage}\hfill
\begin{minipage}{.5\linewidth}
\centering
\medskip
\scalebox{0.45}{
\begin{tabular}{rcccccc}
\hline
& \multicolumn{6}{c}{\textbf{Linear}} \\
\cline{2-7}
& \makecell{\textbf{WMW -- max rel} } & \makecell{\textbf{WMW -- mean }} & \makecell{\textbf{\textit{t} test -- max rel }} & \makecell{\textbf{\textit{t} test -- mean }} & \makecell{\textbf{SEM} } & \makecell{\textbf{SEM -- corrected}} \\
\hline
\multicolumn{7}{l}{$Laplace(0,1.25)$} \\
\multicolumn{7}{l}{\bm{$m=n=15$}} \\
\hline
Setting 1 & 21.5 & \textbf{22.3} & 19.6 & 20.4 & 19.3 & 19.0 \\
Setting 2 & \textbf{21.9} & 21.4 & 21.0 & 21.1 & 19.8 & 21.0 \\
Setting 3 & 22.0 & \textbf{22.5} & 20.6 & 20.3 & 20.1 & 20.3 \\
Setting 4 & 17.3 & \textbf{19.8} & 16.5 & 18.8 & 19.4 & 19.3 \\
\hline
\multicolumn{7}{l}{\bm{$m=n=50$}} \\
\hline
Setting 1 & 61.8 & \textbf{62.0} & 53.2 & 53.2 & 55.0 & 54.6 \\
Setting 2 & 62.2 & \textbf{63.2} & 52.7 & 53.3 & 54.5 & 53.8 \\
Setting 3 & 64.6 & \textbf{66.0} & 52.9 & 52.8 & 54.7 & 54.2 \\
Setting 4 & \textbf{58.9} & 56.9 & 51.7 & 49.8 & 56.0 & 56.1 \\
\hline
\multicolumn{7}{l}{\bm{$m=n=100$}} \\
\hline
Setting 1 & \textbf{92.3} & 92.2 & 83.2 & 82.9 & 83.5 & 83.4 \\
Setting 2 & \textbf{88.1} & 87.9 & 77.7 & 77.5 & 78.2 & 78.1 \\
Setting 3 & \textbf{91.0} & 90.7 & 82.6 & 82.9 & 82.9 & 83.0 \\
Setting 4 & \textbf{85.5} & 80.4 & 77.7 & 74.2 & 79.3 & 79.3 \\
\hline
\multicolumn{7}{l}{Exp} \\
\multicolumn{7}{l}{\bm{$m=n=15$}} \\
\hline
Setting 1 & 22.2 & \textbf{23.1} & 18.1 & 18.2 & 18.7 & 18.3 \\
Setting 2 & 19.7 & \textbf{19.8} & 17.0 & 17.5 & 17.2 & 17.5 \\
Setting 3 & 19.4 & \textbf{20.2} & 16.9 & 17.6 & 16.9 & 17.0 \\
Setting 4 & 15.7 & \textbf{16.0} & 13.4 & 14.9 & 14.8 & 14.9 \\
\hline
\multicolumn{7}{l}{\bm{$m=n=50$}} \\
\hline
Setting 1 & 61.9 & \textbf{62.0} & 40.8 & 41.8 & 42.6 & 42.6 \\
Setting 2 & 56.2 & \textbf{57.6} & 38.0 & 38.2 & 39.9 & 39.3 \\
Setting 3 & 63.0 & \textbf{63.5} & 42.6 & 42.6 & 44.9 & 44.8 \\
Setting 4 & \textbf{50.1} & 45.0 & 36.9 & 36.7 & 40.6 & 40.4 \\
\hline
\multicolumn{7}{l}{\bm{$m=n=100$}} \\
\hline
Setting 1 & 86.7 & \textbf{87.2} & 67.2 & 67.5 & 67.7 & 67.8 \\
Setting 2 & 85.4 & \textbf{85.6} & 65.5 & 66.0 & 66.6 & 66.8 \\
Setting 3 & 88.2 & \textbf{88.4} & 66.4 & 66.3 & 67.3 & 67.6 \\
Setting 4 & \textbf{83.5} & 76.1 & 65.2 & 61.1 & 66.9 & 67.7 \\
\hline
\hline
\end{tabular}
}
\end{minipage}\hfill
\end{table}
\end{landscape}
\end{document}
However, I would like to split this table nicely over multiple pages (and thus by using e.g. longtable), in such way that on one page, I have the results for the N(0,1) and Laplace distribution (side by side), and then on the second page the t_5 and Exp distribution (side by side), i.e. split each table over 2 pages, but have 2 tables side by side by using minipage inside long table.
I know I could converge them and just make one large table and then use long table, however, I would really like not to rewrite the code (since I have 10 more tables like this). Does someone know how I could do this? I tried several ways, but none of them produce the result I am looking for.
Thank you for all your feedback!
Heidelinde
The latex output from R stargazer is too large to fit on one page. I cannot find a way to resolve this issue and break the table onto another page.
\begin{longtable}{#{\extracolsep{5pt}}lD{.}{.}{-3} D{.}{.}{-3} D{.}{.}{-3} }
\caption{test caption \label{models3-5} } \\
\\[-1.8ex]\hline
\hline \\[-1.8ex]
& \multicolumn{3}{c}{\textit{Dependent variable:}} \\
\cline{2-4}
\\[-1.8ex] & \multicolumn{3}{c}{Vote decision} \\
& \multicolumn{1}{c}{Model 3} & \multicolumn{1}{c}{Model 4} & \multicolumn{1}{c}{Model 5} \\
\\[-1.8ex] & \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} & \multicolumn{1}{c}{(3)}\\
\hline \\[-1.8ex]
Intercept & -15.633^{***} & -37.105^{***} & -45.338^{***} \\
& (5.889) & (9.130) & (9.962) \\
& & & \\
male & 16.627^{***} & 11.990^{*} & 8.896 \\
& (5.579) & (6.139) & (6.512) \\
& & & \\
birthyear & 0.008^{***} & 0.018^{***} & 0.023^{***} \\
& (0.003) & (0.005) & (0.005) \\
& & & \\
educ; Secondary II & -24.802^{***} & -24.624^{***} & -25.044^{***} \\
& (5.819) & (6.387) & (6.742) \\
& & & \\
educ; Tertiary & 44.767 & 21.210 & 36.447 \\
& (37.172) & (41.749) & (44.626) \\
& & & \\
household keeper & 23.563 & 16.935 & 1.766 \\
& (17.330) & (19.602) & (20.231) \\
& & & \\
children & 53.961^{***} & 71.322^{***} & 71.402^{***} \\
& (16.251) & (17.778) & (18.504) \\
& & & \\
church attendance & 7.966 & 7.216 & 5.639 \\
& (5.703) & (6.295) & (6.637) \\
& & & \\
taxes & & 26.108^{***} & 30.114^{***} \\
& & (7.412) & (7.876) \\
& & & \\
social expenditure & & -4.277 & -9.684 \\
& & (7.544) & (7.940) \\
& & & \\
chances for foreigners & & & 18.598^{***} \\
& & & (7.095) \\
& & & \\
materialism & & & 19.972^{**} \\
& & & (9.885) \\
& & & \\
male:birthyear & -0.009^{***} & -0.006^{**} & -0.005 \\
& (0.003) & (0.003) & (0.003) \\
& & & \\
birthyear:educ; Secondary II & 0.013^{***} & 0.013^{***} & 0.013^{***} \\
& (0.003) & (0.003) & (0.003) \\
& & & \\
birthyear:educ; Tertiary & -0.023 & -0.011 & -0.019 \\
& (0.019) & (0.021) & (0.023) \\
& & & \\
birthyear:household keeper & -0.012 & -0.009 & -0.001 \\
& (0.009) & (0.010) & (0.010) \\
& & & \\
birthyear:children & -0.027^{***} & -0.036^{***} & -0.036^{***} \\
& (0.008) & (0.009) & (0.009) \\
& & & \\
birthyear:church attendance & -0.004 & -0.004 & -0.003 \\
& (0.003) & (0.003) & (0.003) \\
& & & \\
birthyear:taxes & & -0.013^{***} & -0.015^{***} \\
& & (0.004) & (0.004) \\
& & & \\
birthyear:social expenditure & & 0.001 & 0.004 \\
& & (0.004) & (0.004) \\
& & & \\
birthyear:chances for foreigners & & & -0.010^{***} \\
& & & (0.004) \\
& & & \\
birthyear:materialsim & & & -0.011^{**} \\
& & & (0.005) \\
& & & \\
\hline \\[-1.8ex]
Observations & \multicolumn{1}{c}{7,313} & \multicolumn{1}{c}{7,061} & \multicolumn{1}{c}{6,879} \\
Log Likelihood & \multicolumn{1}{c}{-4,578.775} & \multicolumn{1}{c}{-3,873.386} & \multicolumn{1}{c}{-3,558.999} \\
Akaike Inf. Crit. & \multicolumn{1}{c}{9,185.550} & \multicolumn{1}{c}{7,782.772} & \multicolumn{1}{c}{7,161.997} \\
\hline
\hline \\[-1.8ex]
\textit{Note:} & \multicolumn{3}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\
& \multicolumn{3}{r}{Source: Selects postelection survey 2011-2019} \\
\end{longtable}
\end{table}
I tried to solve the issue using the longtable package, however, I still wasn't able to cut the table. Is there another way to do it or how exactly does the stargazer output need to be altered in order to stop overfloating?
I am trying to draw table in latex but when I compile my latex file it misses one boarder line of the table as you can see in this image. I have tried all possible way but no luck if any one can help. Here is the image that shows missing boarder line in bottom
and this is my code that i use to generate table
\begin{table}
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{|l|l|l|l|l|l|}
\hline
Feature Extraction & Feature selection & classifier & Accuracy & precision & recall \\ \hline
\multirow{7}{*}{GLCM, GLDM, Texture Feature} & \multirow{7}{*}{X} & SVM & 89.02 & 86.36 & 77.24 \\ \cline{3-6}
& & DT & 85.37 & 75 & 80.49 \\ \cline{3-6}
& & SVM-RBF & 92.68 & 94.57 & 70.73 \\ \cline{3-6}
& & LR & 89.02 & 80.34 & 76.42 \\ \cline{3-6}
& & NB & 68.7 & 78.95 & 48.78 \\ \cline{3-6}
& & KNN & 92.28 & 93.4 & 80.49 \\ \cline{3-6}
& & Rf & 87.4 & 98.94 & 75.61 \\ \cline{2-6}
\multirow{7}{*}{} & \multirow{7}{*}{PCA} & SVM & 59.35 & 82.5 & 26.83 \\ \cline{3-6}
& & DT & 61.38 & 60.53 & 56.1 \\ \cline{3-6}
& & SVM-RBF & 64.63 & 81.25 & 42.28 \\ \cline{3-6}
& & LR & 57.72 & 80.39 & 33.33 \\ \cline{3-6}
& & NB & 60.16 & 71.19 & 34.15 \\ \cline{3-6}
& & KNN & 60.57 & 57.84 & 47.97 \\ \cline{3-6}
& & RF & 64.63 & 78.21 & 49.59 \\ \cline{2-6}
\multirow{7}{*}{} & \multirow{7}{*}{Univariate selection} & SVM & 84.55 & 78.02 & 57.72 \\ \cline{3-6}
& & DT & 80.89 & 71.12 & 72.36 \\ \cline{3-6}
& & SVM-RBF & 84.55 & 78.16 & 55.28 \\ \cline{3-6}
& & LR & 82.52 & 78.57 & 62.6 \\ \cline{3-6}
& & NB & 70.73 & 83.33 & 44.72 \\ \cline{3-6}
& & KNN & 83.74 & 69.49 & 66.67 \\ \cline{3-6}
& & RF & 80.08 & 75.51 & 60.16 \\ \cline{2-6}
\end{tabular}
\end{adjustbox}
\end{table}
Your last \cline{2-6} must be a \hline command instead. Then you're ok :)
I'm trying to draw the table of the image, but I can not find the way to do it with latex.
\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}
I'd suggest using booktabs:
\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.
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}
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:
Alignments, line breaks and spacing may be considerably improved, also depending on your time and objectives.
I try to format my math like this in MathJax:
How can I do long division of polynomials in MathJax?
Old post, but I couldn't find an answer elsewhere, so here's how I solved this issue with two side-by-side arrays. Couldn't figure out how to make the lines shorter as I could in LaTex, but this was good enough for me:
<span class="math display">\[\begin{array}{r}
\\
x^2 - 3) \\
\phantom{.} \\
\phantom{.} \\
\phantom{.} \\
\phantom{.} \\
\phantom{.} \\
\phantom{.} \\
\phantom{.} \\
\phantom{.} \\
\phantom{.} \\
\end{array}
\begin{array}{rrrrrr}
& & x^3 & -2x^2 & +4x & -6 \\ \hline
x^5 & -2x^4 & + x^3 & &-8x & +18 \\
-x^5 & &+3x^3 \\ \hline
& -2x^4 & +4x^3 \\
& 2x^4 & &-6x^2 \\ \hline
& & 4x^3 & -6x^2 & -8x \\
& & -4x^3 & &+12x \\ \hline \\
& & &-6x^2 & +4x & +18 \\
& & & 6x^2 & & -18 \\ \hline
& & & & 4x
\end{array}\]</span>