1

When I'm adding a caption to my table, it consumes the same height but including the caption, so that row heights are reduced.

What I want is the same row heights like before, but with a caption added.

\documentclass{scrartcl}
\usepackage{tabularx}
\usepackage{float}

\usepackage{setspace}
\onehalfspacing

\begin{document}

\begin{tabularx}{\textwidth}{l|X}
    % content
    \hline
    Daten-E/A
    & Datenverbindung via USB zum Smart Controller
    \\ \cline{2-2}  & Datenverbindung via Bluetooth zu mobilen Endgeräten
    \\ \hline
    Sensorik
    & Integrierter Vibrationssensor
    \\ \cline{2-2}  & Integrierter Temperatursensor
    \\ \hline
\end{tabularx}
\begin{table}[htbp]
    \begin{tabularx}{\textwidth}{l|X}
        % content
        \hline
        Daten-E/A
        & Datenverbindung via USB zum Smart Controller
        \\ \cline{2-2}  & Datenverbindung via Bluetooth zu mobilen Endgeräten
        \\ \hline
        Sensorik
        & Integrierter Vibrationssensor
        \\ \cline{2-2}  & Integrierter Temperatursensor
        \\ \hline
    \end{tabularx}
    \caption{Technische Daten}
    \label{technische-daten}
\end{table}
\end{document}

Without table wrapped around tabularx. This are my preferred row heights without table

With table and caption. Those are the shrinked rows. with table

11
  • Welcome to TeX.SE. Please, be so kind, to include always a compilable MWE (Minimal Working Example). It helps us to help you.
    – Jan
    Jan 31, 2017 at 9:15
  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Jan 31, 2017 at 9:15
  • What should TeX do with your table? Shrink it vertically to fit the caption? That would be really bad typography. Jan 31, 2017 at 9:17
  • I cannot see any difference in the table row height for the cases with and without caption in your example. Which makes sense since the caption does not have anything to do with the table. I probably misunderstood something, can you explain the problem a bit more?
    – StefanH
    Jan 31, 2017 at 9:39
  • As far I can see your MWE make exactly what you want when compiled with pdflatex.
    – Fran
    Jan 31, 2017 at 9:41

1 Answer 1

1

As predicted:-) the edited code example uses setspace. By design that uses single spacing in figures and tables (which is the usual requirement).

If you want to increase the space inside the table just repeat the \onehalfspacing after \begin{table}.

1
  • Thank you very much, this was the fix i looked for! Plus, now I know how to ask good questions :-)
    – heyfrank
    Jan 31, 2017 at 12:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .