I have made a table in Overleaf (Latex). The problem, however, is that the table goes outside the paper. Like this:
I think the problem is with Notes, because when I remove Notes, the problem is solved (but I want to keep Notes therefore the problem). Does anyone have tips? My code is:
\documentclass[12pt]{article}
\begin{document}
\begin{table}[!htbp] \centering
\caption{The effect of time on negative campaigning and trait attacks and the effect of opposition party, (supporting, governing party), electoral loss, and ideology on negative campaigning.}
\begin{tabular}{@{\extracolsep{5pt}}lcccccc}
\\[-1.8ex]\hline
\hline \\[-1.8ex]
& \multicolumn{6}{c}{\textit{Dependent variables}} \\
\cline{2-7}
\\[-1.8ex] & \multicolumn{6}{c}{ } \\
& N-C & T-A & N-C & N-C & N-C & N-C \\
\\[-1.8ex] & (1) & (2) & (3) & (4) & (5) & (6)\\
\hline \\[-1.8ex]
Time (1970-2022) & $-$0.550$^{***}$ & $-$1.640$^{***}$ & & & & \\
& (0.000) & (0.000) & & & \\
& & & & & & \\
Supporting Party (= ref.) & & & & & & \\
& & & & & & \\
& & & & & & \\
Governing Party & & & $-$3.512 & & & $-$1.830 \\
& & & (2.793) & & & (3.289) \\
& & & & & & \\
Opposition Party & & & $-$4.202$^{*}$ & & & $-$4.000$^{**}$ \\
& & & (1.753) & & & (1.299) \\
& & & & & & \\
Electoral Loss & & & & 0.005 & & 0.008 \\
& & & & (0.012) & & (0.011) \\
& & & & & & \\
Ideology & & & & & 1.781$^{*}$ & 1.764$^{*}$ \\
& & & & & (0.851) & (0.722) \\
& & & & & & \\
Ideology dummy (= SD) & & & & & $-$3.041 & $-$2.912$^{*}$ \\
& & & & & (1.620) & (1.224) \\
& & & & & & \\
Constant & 15.300 & 27.540 & 11.031$^{***}$ & 7.626$^{***}$ & 3.869$^{*}$ & 6.395$^{**}$ \\
& (0.000)& (0.000) & (2.173) & (1.488) & (1.922) & (2.371) \\
& & & & & & \\
\hline \\[-1.8ex]
\textit{Observations} & 103 & 103 & 103 & 103 & 103 & 103 \\
\textit{Adjusted R$^{2}$ }& 1.000 & 1.000 & 0.008 & $-$0.011 & 0.035 & 0.037 \\
\\[-1.8ex]\hline
\hline \\[-1.8ex]
\multicolumn{6}{@{}p{\textwidth}@{}}{\small \textbf{Notes:} N-C stands for negative campaigning and T-A stands for trait attacks. Ref. stands for reference category. Coefficients are the estimates of the ordinary least squares regression with the robust standard errors clustered on parties in parentheses. All models include the election year dummies as fixed effects (not shown due to too little space in the table). * represents a significance level of $p$ $<$ 0.05 (5\%), ** represents a significance level of $p$ $<$ 0.01 (1\%), and *** represents a significance level of $p$ $<$ 0.001 (0.1\%).}
\end{tabular}
\end{table}
\end{document}




threeparttableortaltblroftabularraypackage, use ofScolumn type for aligning of numbers at decimal points etc. – Zarko Nov 25 '22 at 00:05documentclassand table contents) – Zarko Nov 25 '22 at 00:08\multicolumn{6}...should be changed to\multicolumn{7}...as you define 7 columns. This is one of the reasons of table begin larger than expected. – Celdor Nov 25 '22 at 10:40