# Wrapping table around tabularx reduces row height

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

With table and caption. Those are the shrinked rows.

• 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 '17 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. – Reinstate Monica - M. Schröder Jan 31 '17 at 9:15
• What should TeX do with your table? Shrink it vertically to fit the caption? That would be really bad typography. – Reinstate Monica - M. Schröder Jan 31 '17 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 '17 at 9:39
• As far I can see your MWE make exactly what you want when compiled with pdflatex. – Fran Jan 31 '17 at 9:41

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}.