Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to put several tables in the same table float like this:

\documentclass[a4paper, 12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{subfig}
\begin{document}

\begin{table}

\caption{Internal exon scores}\label{tab:internal}
\begin{tabular}{|c|l|l|}
\hline
Ranking&Exon Coverage&Splice Site Support\\
\hline
E1&Complete coverage by a single transcript&Both splice sites\\
E2&Complete coverage by more than a single transcript&Both splice sites\\
E3&Partial coverage&Both splice sites\\
E4&Partial coverage&One splice site\\
E5&Complete or partial coverage&No splice sites\\
E6&No coverage&No splice sites\\
\hline
\end{tabular}

\caption{External exon scores}\label{tab:external}
\begin{tabular}{|c|l|l|}
\hline
Ranking&Exon Coverage&Internal Splice Site Coverage\\
\hline
X1&Complete coverage by one or more transcripts&Splice site covered\\
X2&Exon coverage >= 80\%&Splice site covered\\
X3&Exon coverage < 80\%&Splice site covered\\
X4&Exon coverage < 80\%&Splice site not covered\\
X5&No coverage&Splice site not covered\\
\hline
\end{tabular}

\end{table}
\end{document}

When I build the document, table 2's caption is closer to the bottom of table 1, which makes things confusing. hspace{} doesn't seem to work in the table environment. I've worked out that the subfloat package appears to be causing the spacing behaviour of the captions. Is there anything else that I can do to introduce a blank horizontal break to space out the captions?

share|improve this question
2  
It looks fine with the article document class. Perhaps you could turn your code into a complete compilable file, a so-called minimal working example (MWE) that shows the behaviour? –  Jake Aug 21 '11 at 10:47
    
Yup, you're right. I probably should have stripped it down to the basics before asking. I found that the problem was caused by using the subfloat package, which I require for a couple of graph floats in my document. I updated the example to a MWE that reproduces the issue. –  kikumbob Aug 21 '11 at 11:09
1  
Simply use \vspace between the tabular environements, or something like \medskip or \bigskip. –  Axel Sommerfeldt Aug 21 '11 at 11:32

3 Answers 3

up vote 6 down vote accepted

The spacing is caused by the caption package, which is loaded by subfig. You can adjust the two parameters aboveskip and belowskip provided by caption using something like \captionsetup{belowskip=12pt,aboveskip=4pt} in your preamble. Note that below and above have the meaning as it would make sense for figure captions below a figure: aboveskip is the space between the content and the caption (which would be above the caption for a figure caption that's set underneath the figure, but below it for a table caption that's set above the table), belowskip is the space between the caption and the surrounding text.

Here's your example with the aboveskip and belowskip adjusted:

\documentclass[a4paper, 12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{subfig}

\captionsetup{belowskip=12pt,aboveskip=4pt}
\begin{document}

\begin{table}

\caption{Internal exon scores}\label{tab:internal}
\begin{tabular}{|c|l|l|}
\hline
Ranking&Exon Coverage&Splice Site Support\\
\hline
E1&Complete coverage by a single transcript&Both splice sites\\
E2&Complete coverage by more than a single transcript&Both splice sites\\
E3&Partial coverage&Both splice sites\\
E4&Partial coverage&One splice site\\
E5&Complete or partial coverage&No splice sites\\
E6&No coverage&No splice sites\\
\hline
\end{tabular}

\caption{External exon scores}\label{tab:external}
\begin{tabular}{|c|l|l|}
\hline
Ranking&Exon Coverage&Internal Splice Site Coverage\\
\hline
X1&Complete coverage by one or more transcripts&Splice site covered\\
X2&Exon coverage >= 80\%&Splice site covered\\
X3&Exon coverage < 80\%&Splice site covered\\
X4&Exon coverage < 80\%&Splice site not covered\\
X5&No coverage&Splice site not covered\\
\hline
\end{tabular}

\end{table}
\end{document}
share|improve this answer

Since you use subfig, you can adjust this by \captionsetup of the caption package, for example:

\captionsetup[table]{aboveskip=0pt}
\captionsetup[table]{belowskip=10pt}

With these adjustments, you will get this output:

tables with captions

share|improve this answer

without loading another package use

\usepackage{subfig}

\let\belowcaptionskip\abovecaptionskip
    
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.