Top alignment of cell content in tabularx
You can make the inner tabulars top align by using [t]
It may just be an artifact of your small example but tabularx can do nothing to help here as the inner tabular is fixed to its natural width so can not reflow to whatever width the X
column specifies.
\documentclass{article}
\usepackage{tabularx,booktabs}
\begin{document}
\noindent
\begin{tabularx}{\textwidth}{lX}
\toprule
Mittel & technische Details\\
\midrule
%first row of tabularx
Laptop &
\begin{tabular}[t]{ll}
MacBook Pro & \\
Baujahr 2010 & \\
Prozessor & 2.4 GHz Intel Core 2 Duo \\
Speicher & 4 GB 1067 MHz DDR3 \\
Software & Mac OS X Lion 10.7.5 (11G63)
\end{tabular}\\[3em]
%second row of tabularx
Programmierumgebung &
\begin{tabular}[t]{ll}
Version & 8.0.4.0 \\
Plattform & Mac OS x86 (32-bit, 64-bit Kernel)
\end{tabular}\\
\bottomrule
\end{tabularx}
\end{document}
Why not use a single tabularx
environment instead of one inside a tabular
?
\begin{tabularx}{\textwidth}{llX}
\toprule
Mittel & technische Details & \\
\midrule
Laptop & MacBook Pro & \\
& Baujahr 2010 & \\
& Prozessor & 2.4 GHz Intel Core 2 Duo \\
& Speicher & 4 GB 1067 MHz DDR3 \\
& Software & Mac OS X Lion 10.7.5 (11G63) \\[3em]
Programmierumgebung & Version & 8.0.4.0 \\
& Plattform & Mac OS x86 (32-bit, 64-bit Kernel)\\
\bottomrule
\end{tabularx}
One can specify the vertical alignment -- top, middle (default), and bottom -- of a tabular
environment via an optional argument. In the code below, I use [t]
(for "top" alignment). Note that it's also necessary now to suppress explicitly, via a @{}
directive, the whitespace that's otherwise inserted at the left edge of the cell when using the X
column type for a cell that contains a tabular
environment.
\documentclass{article}
\usepackage{tabularx,booktabs}
\begin{document}
\noindent
\begin{tabularx}{\textwidth}{lX}
\toprule
Mittel & technische Details\\
\midrule
%first row of tabularx
Laptop &
\begin{tabular}[t]{@{}ll}
% use [t] alignment specifier, and @{} to
% suppress extra whitespace at left edge
MacBook Pro & \\
Baujahr 2010 & \\
Prozessor & 2.4 GHz Intel Core 2 Duo \\
Speicher & 4 GB 1067 MHz DDR3 \\
Software & Mac OS X Lion 10.7.5 (11G63)
\end{tabular}\\[5em]
%second row of tabularx
Programmierumgebung &
\begin{tabular}[t]{@{}ll}
Version & 8.0.4.0 \\
Plattform & Mac OS x86 (32-bit, 64-bit Kernel)
\end{tabular}\\
\bottomrule
\end{tabularx}
\end{document}