Hi, i am new to this website and to latex, and i was wondering if i could get some help on latex.
i am trying to produce a table with caption on top. However, my caption right now is much wider than the width of the table itself, so i was wondering if any of you know how to get the caption to have the same width as the table's? My code is the following.
\begin{sidewaystable} [h]
\centering
\begin{center}
\caption [short caption] {The Fama and French 3 facotrs model is estimated for each firm during the pre-event period from day -130 to day -11. Abnormal returns are then computed for each firm based on Fama and French 3 factors model risk adjustments. Daily abnormal returns are averaged across firms and cumulated. Panel A's sample includes XXX firms and Panel B's sample includes YYY firms.}
\begin{tabular}{c c c c}
\hline \\%inserts single horizontal lines
Event Period (days) & Average Daily & t-statistic & Wilcoxon sign test \\[2ex]
& Abnormal Return \\[2ex]
%heading
\hline \\% inserts single horizontal line\textcolor[rgb]{0.00,0.00,0.00}{}
\multicolumn{4}{c}{Panel A: The proposal was rejected} \\[0.5ex]
\hline \\[2ex] %inserts single line
\hline \\[0.8ex]
\multicolumn{4}{c}{Panel B: The proposal was Accepted} \\[0.5ex]
\hline \\[2ex]
\hline
\multicolumn{4}{l}{$^{***}$, $^{**}$, $^{*}$, indicate significance at the 5 and 10 percent levels, respectively.} \\[0.5ex]
\end{tabular}
\end{center}
\end{sidewaystable}
thanks for your help, really appreciate it.
General ⇒ Need help with table in latex
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Need help with table in latex
I wonder why you are producing this as a rotated table. Actually this table fits the page width in portrait format. But this may be a matter of page geometry. A possible solution comes with the caption package, which lets you - also locally - customize your captions in many ways. As far as I know the sidwaystable environment doesn't accept any optional arguments.
Best regards and welcome to the board
Thorsten¹
Best regards and welcome to the board
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Need help with table in latex
thanks for the prompt reply.
The reason i am using rotated table is because i have other pages which are just the normal essay style stuffs (mainly text). If there is a way that i could make only 1 page to become portrait, that would be great.
Also, i just started to use latex yesterday, so i am not too familiar with the options on caption you mentioned. But before i started the table, i put down the code
\usepackage[font=sf, labelfont={sf,bf}, margin=1cm]{caption}
Are there any other options i can put into this code so that my caption would share the same width as my tables?
thanks alot
The reason i am using rotated table is because i have other pages which are just the normal essay style stuffs (mainly text). If there is a way that i could make only 1 page to become portrait, that would be great.
Also, i just started to use latex yesterday, so i am not too familiar with the options on caption you mentioned. But before i started the table, i put down the code
\usepackage[font=sf, labelfont={sf,bf}, margin=1cm]{caption}
Are there any other options i can put into this code so that my caption would share the same width as my tables?
thanks alot
Need help with table in latex
Since the caption package just takes care about the caption itself it knows nothing around the surrounding of the caption, so it can't offer such things.booji wrote:Are there any other options i can put into this code so that my caption would share the same width as my tables?
But there are table packages which offer this functionality, e.g. the threeparttable, the floatrow, and the ctable package. (I'm sure there are even more but these are the ones I'm aware off.)
Axel