[Tex/LaTex] Add double hline in table below caption

captionsrulestables

I would like to insert a double \hline below the caption in my table. The caption is positioned at the top of my table. MWE is below. The %\hline \hline line is where I would like the double \hline to be.

\documentclass{article}
\begin{document}

\begin{table}
\caption{Title}
%\hline \hline 
\begin{tabular}{lc}
Column heading & More column heading
\hline
Data & More data
\end{tabular}
\end{table}

\end{document}

Best Answer

One option is to use the caption package to define a ruled style (adjust the settings to suit):

\documentclass{article}
\usepackage{caption}

\DeclareCaptionFormat{ruled}{
  #1#2#3\par\vspace{-.65\baselineskip}\hrulefill\par\vspace{-.83\baselineskip}\hrulefill}
\captionsetup[table]{format=ruled}

\begin{document}

\begin{table}
\centering
\caption{Title}
\begin{tabular}{lc}
Stuff & More stuff 
\end{tabular}
\end{table}

\end{document}

enter image description here

However, if your table begins with a horizontal rule, this might look odd.

If the double rules should be part of the tabular material, you can use for example booktabs and its rule commands to define the double rule (in an example below I used \specialrule to illustrate some control on the spacing requested in comment):

\documentclass{article}
\usepackage{caption}
\usepackage{booktabs}

\newcommand\doubleRule{\toprule\toprule}
\newcommand\doublerule{\toprule\specialrule{\heavyrulewidth}{\doublerulesep}{0.95em}}

\begin{document}

\begin{table}
\centering
\caption{A test table}
\begin{tabular}{l r}
\doubleRule
Header1 & Header2 \\
\midrule
Column1a & Column 2a \\
Column1a & Column 2a \\
\bottomrule
\end{tabular}
\end{table}

\captionsetup{skip=2pt}
\begin{table}
\centering
\caption{A test table}
\begin{tabular}{l r}
\doublerule
Header1 & Header2 \\
\midrule
Column1a & Column 2a \\
Column1a & Column 2a \\
\bottomrule
\end{tabular}
\end{table}

\end{document} 

enter image description here