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 have a table which works ok...as per example below. But in the thesis, the right column is centered and caption forced to below table. Is there a way I can make it look like?

\documentclass[12pt]{article} 
\begin{document}
\begin{table}[t]
\caption{Four months plan: where,what how}
\begin{tabular}{lclclclc}
\hline
\hline
Month & Week & Programme\\
\hline
May & 3-4 & Cycle Tour\\
June & 1-2 & DCP Project\\
July & 1-2 & Clean Energy\\
August & 3-4 & Interim Report\\
\hline
\end{tabular}
\end{table}
\end{document}
share|improve this question

2 Answers 2

up vote 18 down vote accepted

There are multiple ways to force a table caption on top of the tables.


You could use the float package and use the following code:

\usepackage{float}
\floatstyle{plaintop}
\restylefloat{table}

A drawback of this is that you can't have more than one caption per table, i.e. you can't have two different tabulars with two captions side-by-side.

If your table caption are already forced to be below the table (normally they are placed where the \caption macro is used), some part of your thesis, maybe a custom package, might already use float with different settings.


You can also set the table caption position to the top using:

\usepackage[tableposition=top]{caption}

However, this should only influence the vertical skip around the caption. Without this line the caption in your example should be already placed on top, just not with the correct distance.


Finally you can define a \captionabove macro and place this at the begin of the table environment. This macro uses the normal \caption but uses the correct vertical spacing for top-captions (by compensating the spacing added by \caption and adding the correct one).

(It would also be possible to swap the values of the \abovecaptionskip and \belowcaptionskip registers, but this requires grouping which has a negative impact on a \label which follows.)

\makeatletter
\newcommand{\captionabove}[2][]{%
    \vskip-\abovecaptionskip
    \vskip+\belowcaptionskip
    \ifx\@nnil#1\@nnil
        \caption{#2}%
    \else
        \caption[#1]{#2}%
    \fi
    \vskip+\abovecaptionskip
    \vskip-\belowcaptionskip
}

% If \captionof is required:
% Usage: \captionaboveof[<short caption>]{table}{<caption>}
\newcommand{\captionaboveof}[3][]{%
    \vskip-\abovecaptionskip
    \vskip+\belowcaptionskip
    \def\@captype{#2}%
    \ifx\@nnil#1\@nnil
        \caption{#3}%
    \else
        \caption[#1]{#3}%
    \fi
    \vskip+\abovecaptionskip
    \vskip-\belowcaptionskip
}
\makeatother
share|improve this answer

Even with the \caption command placed after the tabular environment, you may force the caption on top of the table by using the floatrow package and its \floatsetup macro.

\documentclass[12pt]{article}
\usepackage{floatrow}
\floatsetup[table]{capposition=top}
\begin{document}
\begin{table}[t]
\begin{tabular}{lclclclc}
\hline
\hline
Month & Week & Programme\\
\hline
May & 3-4 & Cycle Tour\\
June & 1-2 & DCP Project\\
July & 1-2 & Clean Energy\\
August & 3-4 & Interim Report\\
\hline
\end{tabular}
\caption{Four months plan: where,what how}
\end{table}
\end{document}

enter image description here

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.