# Table caption on top of page - remove vertical space [duplicate]

I guess my problem is related to the caption. When a table (with the caption on top) appears on top of a page, there is always sone vertical whitespace before. Figure however (caption below) align with the top perfectly. I guess this is because of the caption? Can I somehow globally remove this whitespace? Caption offers some option to tell it whether the caption is on top or bottom, but this doesn't help... Here is my code:

\documentclass[
12pt,
pdftex,
a4paper,
parskip=half,
]{scrreprt}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{showframe}
\usepackage{blindtext}

\begin{document}

\begin{table}[t]
\centering
\caption\textbf{Fancy table}
\begin{tabular}{ccc}
This is & a fancy & table \\
\end{tabular}
\end{table}

\Blindtext[5]{5}

\end{document}

You have to tell KOMA-Script, that you want table headings instead of table signatures:

\documentclass[
12pt,
a4paper,
parskip=half,
captions=tableheading% formatting for table headings (see the KOMA-Script manual)
]{scrreprt}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{showframe}
\usepackage{blindtext}
\setkomafont{caption}{\bfseries}% caption text (but not label) bf (see the KOMA-Script manual)

\begin{document}

\begin{table}[t]
\centering
\caption{Fancy table}
\begin{tabular}{ccc}
This is & a fancy & table \\
\end{tabular}
\end{table}

\Blindtext[5]{5}

\end{document}

Note, \caption has a mandatory argument!

Note also that you should not use \textbf to make the table title bold, but use \setkomafont{caption}{…} to change the font of the caption text (and optionally also \setkomafont{captionlabel}{…} for the label of the caption text.

• Thanks, the KOMA option helped. The \textbf and the madatory option, I am aware of. It was just some copy&paste error for the MWE. – Benedikt Jun 21 '17 at 10:03

There are two lengths: \abovecaptionskip and \belowcaptionskip. Usually caption is put below the figure/table, so \abovecaptionskip has some non zero value and belowcaptionskip is equal to zero. You should not change this values globally -- they are used both for figures and tables.

I suggest to use the caption package and define two different setups: one for tables and default for figures. For example:

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

BTW It is a really usefull package.

• Package caption is useful in several cases, but if you use a KOMA-Script class, you don't need package caption to solve this problem. – Schweinebacke Jun 21 '17 at 11:15