# Making advanced table. Centering and line above tabular environment, 3 columns

I need some help creating the table below. I only need the full sample and parameters columns, and therefore only three columns. However I have issues with centering, top line above the TABLE 3 and Caption. What i ran so far (now I only use 2 columns, so need to add 1). And yes, I want to fill the entire page..:

\documentclass{article}
\usepackage{booktabs,amsmath,caption,dcolumn}
\newcolumntype{d}[1]{D..{#1}}
\begin{document}
\begin{table}[h]
\caption{\textbf {\textsc{Parameter estimates of the No-Arbitrage Yield only model}}}
\label{table:Parameter estimates of the No-Arbitrage Yield only model}
\begin{tabular*}{\textwidth}{@{}l@{\extracolsep{\fill}}d{4}d{4}d{4}@{}}%definerer antall kolonner
\toprule[0.5pt]
\toprule[0.5pt]
Parameters & \multicolumn{2}{c}{Full Sample} \\
\midrule[0.5pt]
\textbf{$\delta_0$}\\
& & \text{Factor autoregressive parameters}\\
$\rho_{LL}$& 1.000 & (0.342) \\
$\rho_{SS}$& 0.999 & (0.233)\\
& \\
$\lambda_S^0$& &\\
$\lambda_L^0$& &\\
$\lambda_S^1$& 0.0912 &\\
$\lambda_S^1$&-0.1612 &\\
\\
$\sigma_L$   &0.0340 &\\
$\sigma_L$   &0.0795 &\\
\hline \hline
\end{tabular*}
\scriptsize
Notes:\hfill\parbox[t]{14cm}{The table shows the results from the market model estimations. Each column presents the mean and standard deviation for all the companies' CAR in the designated event window period. The first column, (0, 2), reports $\mu$ and $\sigma$ for the event window period spanning from day 0 to 2 days after the dividend announcement (3 day window). Where day [0] is the dividend announcement day. Columns (2), (3) and (4) widens the event window to 5, 11 and 21 days. The t-values are reported below in parentheses and calculated as $\frac{\mu}{\sigma/\sqrt{n}}$. ***, ** and * denote significance at the 1, 5 and 10\% levels, respectively.}
\end{table}
\end{document}

-
Please describe your problem with more precision. I did not understand what you have meant. – saldenisov Mar 28 '14 at 14:46
Please always post a complete document showing all packages needed, not just a fragment that people can not use. – David Carlisle Mar 28 '14 at 14:48
Well, that textit{} part was just an experiment and can be ignored. However what i am trying to do here is to have table, which design is similar to the one above, however only the three first columns. Added new code, however need a line above TABLE caption (like the pic) and center the columns (such that it looks "neat") – MAT-TEX Mar 28 '14 at 15:35

Here is a start using a combination of float (for styling the layout of the float with a top rule), tabularx (for easy setting of fixed-width tables), booktabs (for awesomeness) and caption (for formatting of the caption style):

\documentclass{article}
\usepackage{float}% http://ctan.org/pkg/float
\makeatletter
\newcommand\fs@topruled{\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@ruled
\def\@fs@pre{\hrule height.8pt depth0pt \kern2pt}%
\def\@fs@post{}%
\def\@fs@mid{}%
\let\@fs@iftopcapt\iftrue}
\makeatletter
\floatstyle{topruled}
\restylefloat{table}

\usepackage{tabularx,booktabs,caption}% http://ctan.org/pkg/{tabularx,booktabs,caption}
\captionsetup[table]{
labelsep = newline,
textfont = sc,
name = TABLE,
skip = \medskipamount}
\begin{document}

\begin{table}[h]
\caption{Parameter estimates of the No-Arbitrage Yield only model}
\label{tab:parameter_estimates}
\begin{tabularx}{\linewidth}{@{} X r r @{}}
\toprule[0.5pt]
\toprule[0.5pt]
\small Parameters & \multicolumn{2}{c}{\small Full Sample} \\
\midrule[0.5pt]
$\delta_0$ & \multicolumn{2}{c}{6.2030} \\
& \multicolumn{2}{c}{Factor autoregressive parameters} \\
$\rho_{LL}$ & $1.000$ & $(0.342)$ \\
$\rho_{SS}$ & $0.999$ & $(0.233)$ \\
& \multicolumn{2}{c}{Risk pricing factors} \\
$\lambda_S^0$ & \multicolumn{2}{c}{$0$} \\
$\lambda_L^0$ & $-0.0174$ & $(0.041)$ \\
$\lambda_S^1$ & $0.0912$ & $(0.089)$ \\
$\lambda_S^1$ & $-0.1612$ & $(0.034)$ \\
& \multicolumn{2}{c}{Factor shock volatility parameters} \\
$\sigma_L$ & $0.0340$ & $(0.019)$ \\
$\sigma_L$ & $0.0795$ & $(0.010)$ \\
\bottomrule
\end{tabularx}

\medskip

\parbox{\linewidth}{\scriptsize%
\textsc{Note}:
The table shows the results from the market model estimations. Each column presents the mean and standard deviation for
all the companies' CAR in the designated event window period. The first column, (0, 2), reports~$\mu$ and~$\sigma$ for
the event window period spanning from day~0 to~2 days after the dividend announcement (3~day window). Where day~[0] is
the dividend announcement day. Columns~(2),~(3) and~(4) widens the event window to~5,~11 and~21 days. The $t$-values are
reported below in parentheses and calculated as $\mu / (\sigma / \sqrt{n})$. ***, ** and * denote significance at
the~1,~5 and~10\% levels, respectively.}
\end{table}
\end{document}
-
Excellent. Thank you very much. I tried using \hrule, but I realize now that instead of putting it between the table and tabular environment I ended up putting it outside, rookie mistake ;). Any ways the table looks exactly as I wanted. Many thanks, again. – MAT-TEX Mar 29 '14 at 6:47
Hello. Given the Werner setup I incur a litte problem regarding my figures. Since I want the figure caption to be above the figure I added \restylefloat{figure}, however I do not want the figure to be top ruled, how do I specify this? If necessary I will provide a minimal working example, but the code is exactly as @Werner, with the addition of \restylefloat{figure} below \restylefloat{table} – MAT-TEX Aug 1 '14 at 13:00
@MAT-TEX: Once a style is set (like \floatstyle{topruled}), any subsequent restyling will conform to the set style. So, you can add \floatstyle{plaintop} before \restylefloat{figure} to restyle figures using the plaintop style. – Werner Aug 1 '14 at 16:57

Here's a possible solution that continues to use the tabular* environment, as you do in your example. The rule, i.e., horizontal line, above the caption is generated by an \hrule instruction; the thicknesses of the lines generated by \toprule, \midrule, and \bottomrule are set to the width of the \hrule. The caption package is loaded to affect the appearance of the table caption.

\documentclass{article}
\usepackage{booktabs,amsmath,caption,dcolumn}
\captionsetup{labelsep=newline,
singlelinecheck=false,
textfont=sc}
\newcolumntype{d}[1]{D..{#1}}
\newcommand\mc[1]{\multicolumn{1}{@{}c@{}}{#1}}
\begin{document}
\begin{table}[h]
\hrule

\bigskip
\caption{Parameter estimates of the No-Arbitrage Yield only model}
\label{table:Parameter_estimates}
\begin{tabular*}{\textwidth}{@{}l@{\extracolsep{\fill}}d{2.4}d{2.4}@{}}%definerer antall kolonner
\toprule[0.4pt]\toprule[0.4pt]
Parameters & \multicolumn{2}{c@{}}{Full Sample} \\
\cmidrule{2-3}
& \mc{Point estimate} & \mc{(Standard error)}\\
\midrule[0.4pt]
$\delta_0$\\[1ex]
Factor autoregressive parameters\\
$\rho_{LL}$& 1.000 & (0.342) \\
$\rho_{SS}$& 0.999 & (0.233)\\[1ex]
Risk pricing parameters\\
$\lambda_S^0$& &\\
$\lambda_L^0$& &\\
$\lambda_S^1$& 0.0912 &\\
$\lambda_S^1$&-0.1612 &\\[1ex]
Factor shock validity parameters\\
$\sigma_L$   &0.0340 &\\
$\sigma_L$   &0.0795 &\\
\bottomrule[0.4pt]
\end{tabular*}

\smallskip
\scriptsize
Notes:\hfill\parbox[t]{11cm}{The table shows the results from the market model estimations. Each column presents the mean and standard deviation for all the companies' CAR in the designated event window period. The first column, (0, 2), reports $\mu$ and $\sigma$ for the event window period spanning from day 0 to 2 days after the dividend announcement (3 day window). Where day [0] is the dividend announcement day. Columns (2), (3) and (4) widens the event window to 5, 11 and 21 days. The t-values are reported below in parentheses and calculated as $\sqrt{n}(\mu/\sigma)$. ***, ** and * denote significance at the 1, 5 and 10\% levels, respectively.}
\end{table}
\end{document}
-