0

I'm trying to make a table in Latex, but I dont know how I could make the three cells/columns (AR%, t-test, Patell Z) included in the multicolumn equally wide. Thanks in advance!

Picture of the table/code attached.

Table-code

\newpage
\begin{center}
\normalsize
Table 7: Abnormal returns
\end{center}
% Please add the following required packages to your document preamble:
% \usepackage[table,xcdraw]{xcolor}
% If you use beamer only pass "xcolor=table" option, i.e. \documentclass[xcolor=table]{beamer}
\begin{table}[!htbp] \centering 
  \centerline{%
  \normalsize 
  \renewcommand{\arraystretch}{1.2}
\begin{tabular}{ccccc}
  \hline 
N & Day & \multicolumn{3}{c}{}                                  \\
\multicolumn{2}{c}{} & \multicolumn{3}{c}{\textbf{Abnormal Average Returns}} \\
\vspace{} \\
\multicolumn{2}{c}{} & \overline{AR}\%& \textbf{t-test}& \textbf{Patell Z}\\
\cline{3-5}
1800  & \textbf{-5} & 0,04 & 0,03 & 0,05        \\
1800  & \textbf{-4} & 0,03 & 0,02 & 0,05        \\
1800  & \textbf{-3} & 0,03 & 0,03 & 0,03        \\
1800  & \textbf{-2} & 0,03 & 0,03 & 0,03        \\
1800  & \textbf{-1} & 0,03 & 0,03 & 0,03        \\
\rowcolor[HTML]{EFEFEF} 
1800  & \textbf{0} & 0,03 & 0,03 & 0,03        \\
1800  & \textbf{1} & 0,03 & 0,03 & 0,03        \\
1800  & \textbf{2} & 0,03 & 0,03 & 0,03        \\
1800  & \textbf{3} & 0,03 & 0,03 & 0,03        \\
1800  & \textbf{4} & 0,03 & 0,03 & 0,03        \\
1800  & \textbf{5} & 0,03 & 0,03 & 0,03        \\            
\hline
\end{tabular}
}
\vspace{0,3cm}
\begin{tablenotes}
\footnotesize
Note: REWRITE 
\end{tablenotes}
\end{table}
Peter_96
  • 7
  • 4

1 Answers1

2

I suggest to use the tabularray package. This makes merging cells very easy:

\documentclass{article}

\usepackage{tabularray}
\usepackage{xcolor}

\begin{document}

\begin{tblr}{
  colspec={
    c
    Q[halign=c,mode=math,font=\boldmath]
    Q[1.5cm,halign=c]
    Q[1.5cm,halign=c]
    Q[1.5cm,halign=c]
  },
  row{8}={bg=gray!20!white},
  row{1}={mode=text},
  row{1-2}={font=\bfseries},
  cell{2}{3}={mode=math,font=\boldmath}
}
\hline 
\SetCell[r=2]{} N & \SetCell[r=2]{} Day & \SetCell[c=3]{} Abnormal Average Returns & & \\
\cline{3-5}
& & \overline{AR}\,\% & t-test & Patell Z\\
\hline
1800  & -5 & 0,04 & 0,03 & 0,05        \\
1800  & -4 & 0,03 & 0,02 & 0,05        \\
1800  & -3 & 0,03 & 0,03 & 0,03        \\
1800  & -2 & 0,03 & 0,03 & 0,03        \\
1800  & -1 & 0,03 & 0,03 & 0,03        \\
1800  & 0 & 0,03 & 0,03 & 0,03        \\
1800  & 1 & 0,03 & 0,03 & 0,03        \\
1800  & 2 & 0,03 & 0,03 & 0,03        \\
1800  & 3 & 0,03 & 0,03 & 0,03        \\
1800  & 4 & 0,03 & 0,03 & 0,03        \\
1800  & 5 & 0,03 & 0,03 & 0,03        \\
\hline
\end{tblr}

\end{document}

enter image description here