# Problems with formatting a table in LaTeX

Could anyone please help me find out why I can't get a table similar to the one I'm pasting in the following lines, with the following code? I'm not very experienced in LaTeX and I'm getting frustrated because I can't see where's my error. Thank you!!

\newpage
**\appendix
\chapter{Appendix A: Detailed Regression Results}
\begin{singlespace}
\noindent\textbf{Table 4: Estimation Results of PROCAMPO Capitalization}
\vspace{-5mm}
\begin{center}
\begin{table}[ht]
\centering % used for centering table
\begin{tabular}{|c||l|l|l||l|l|l|}
\hline\hline %inserts double horizontal lines
\multirow{4}{*}{Dependent Variable\: Average Rent per Ha (in logs)}
& \multicolumn{5}{c||}{OLS Estimates With Regional Fixed Effects}
& \multicolumn{1}{|c|}{Heckman Estimates With Regional Fixed Effects} \\      \cline{2-6}
& MAIN SPECIFICATION & ALTERNATIVE $1$ & ALTERNATIVE $2$ & ALTERNATIVE $3$ & ALTERNATIVE $4$ \\  \hline {PROCAMPO per Ha (logs)}&0.0012&0.0023&0.0021&0.00077&0.028&&-0.0071\\
&[0.0099]&[0.0100]&[0.0097]&[0.0098]&[0.030]&&[0.011]\\
&&&&&&&\\
Income Stratum 2 (Family subsistence with linkage to the market)&0.46^{**}&0.45^{**}&0.46^{**}&0.46^{**}&0.40^{**}&&0.46^{**}\\
&[0.17]&[0.18]&[0.18]&[0.18]&[0.17]&&[0.18]\\
Income Stratum 3 (In transition)&0.78^{***}&0.76^{***}&0.78^{***}&0.80^{***}&0.69^{***}&&0.79^{***}\\
&[0.24]&[0.23]&[0.23]&[0.23]&[0.22]&&[0.24]\\[1ex]
\hline\hline %inserts double horizontal lines
\end{tabular}
\label{table:nonlin} % is used to refer this table in the text
\end{table}
\vspace{-3mm}
\begin{flushleft}
{\tiny\tiny Note: All the variables that are not categorical are included in logs. All the regional fixed effects are significant and negative, the more negative magnitude belonging to the Southern region, everything with respect to the Northern region. Please refer to the Appendix A to see the detailed results of the regression. Heteroskedasticity-robust standard errors are in brackets. *10\% significance, **5\% significance, ***1\% significance.\par}
\end{flushleft}
\end{center}
\end{singlespace}
\vspace{.75cm}

• welcome to tex.se!. float table had not to be inside \begin{center} ... end{center}. why you not use caption{for table caption? your table is really huge ... and please help us to help you and extend your code sniped to complete small document, which we can copy and test – Zarko Aug 27 '17 at 23:37
• some errors: \: can be only in math environment, similarly all numbers following by ^{*..}. number of declared columns and used are not the same, this cause bunch of errors. you should carefully check your table and correct this discrepancies. – Zarko Aug 27 '17 at 23:47
• Thank you very much, Zarko! I'll upload a short version of this table in a while, but I appreciate a lot your guidance! – Ariadna Aug 28 '17 at 0:22
• Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See minimal working example (MWE). – Henri Menke Aug 28 '17 at 1:37

Some progress can be made by shortening some of the header cells.

\documentclass{report} % some document class that provides "\chapter" command
\usepackage{setspace,booktabs,array,graphicx,dcolumn,ragged2e}
\newcolumntype{d}[1]{D..{#1}}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\newcommand\mc[1]{\multicolumn{1}{@{}c@{}}{#1}}
\begin{document}
\newpage
**\appendix
\chapter{Detailed Regression Results}
\begin{singlespace}
\noindent\textbf{Table 4: Estimation Results of PROCAMPO Capitalization}

\smallskip\noindent
\resizebox{\textwidth}{!}{%
\begin{tabular}{@{} >{\raggedright}p{5.2cm}
*{6}{d{2.5}} @{}}
\toprule
Dependent Variable: Average Rent per Ha (in logs)
& \multicolumn{5}{c}{OLS Estimates with Regional Fixed Effects}
& \multicolumn{1}{@{}P{2.5cm}@{}}{Heckman Estimates with Regional Fixed Effects} \\
\cmidrule(lr){2-6}
& \mc{Main} & \mc{Alt.\ 1} & \mc{Alt.\ 2} & \mc{Alt.\ 3} & \mc{Alt.\ 4} &\\
\midrule
PROCAMPO per Ha (logs)
&0.0012&0.0023&0.0021&0.00077&0.028&-0.0071\\
&[0.0099]&[0.0100]&[0.0097]&[0.0098]&[0.030]&[0.011]\\
Adjusted Heckman Estimate&&&&&& 0.114\\
Income Stratum 2 (Family subsis-&0.46^{**}&0.45^{**}&0.46^{**}&0.46^{**}
&0.40^{**}&0.46^{**}\\
tence with linkage to the market)&[0.17]&[0.18]&[0.18]&[0.18]&[0.17]&[0.18]\\
`