Perhaps a suggestion, but here is an alternative to your current set up. I've used tabularx
to allow for variable-width tabular
columns (via column type X
), filling up to some fixed with using the tabularx
environment. Additionally, booktabs
provide a cleaner spread of tables vertically, while virtually restricting the use of vertical rules (due to the rule definitions). Either way, the tabular layout helps columnar alignment, which removes the requirement for using vertical rules anyway.
The interior tabular
has been adjusted to provide a natural-width horizontal alignment, as suggested in your ASCII-art interpretation.
\documentclass{article}
\usepackage{threeparttable}% http://ctan.org/pkg/threeparttable
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\usepackage{tabularx}% http://ctan.org/pkg/tabularx
\usepackage[labelfont=normal,font=bf]{caption}%http://ctan.org/pkg/caption
\captionsetup[table]{skip=0pt}
\begin{document}
\begin{table}[!ht]
\caption{Pheno file format}
\begin{threeparttable}
\begin{tabularx}{\textwidth}{lX}
\toprule
\textbf{Pheno file headers} & \multicolumn{1}{c}{\textbf{Notes}} \\
\midrule
sex & The sex column is restricted to the following values: \\[\jot]
& \begin{tabular}{lc}
Sex & Value \\ \midrule
Male & $\phantom{-}1$ \\
Female & $\phantom{-}2$ \\
Missing & $-1$
\end{tabular} \\[\jot]
\midrule
studyid & Description of the study the data belongs to - eg. \texttt{Hapmap6.0}. \\
& If studyid is not given, \texttt{unknown} is used. \\
\midrule
studyid & Description of the study the data belongs to - eg. \texttt{Hapmap6.0}. \\
& If studyid is not given, \texttt{unknown} is used. \\
\bottomrule
\end{tabularx}
\end{threeparttable}
\end{table}
\end{document}
Using \phantom{-}
leaves the correct amount of horizontal (and vertical) space for -
without actually typesetting it. That allows for aligning the entries within the nested tabular
while also centering it.
\jot
is a length of 3pt
. Using it together with \\
, as in \\[\jot]
, pushes the tabular
line break down vertically by 3pt
. Using a length register (like \jot
) is preferred over explicitly using \\[3pt]
, since you can modify \jot
(using, say \setlength{\jot}{5pt}
) in one location and it would take effect wherever it is used after the redefinition, rather than having to manually modify the 3pt
vertical skip everywhere.
Layout changes to the nested/interior tabular
is possible (for example, if you want it horizontally centered within the outer tabularx
, although the existing alignment seems sufficient).
Finally, there's no need to use multirow
anymore, more obvious reasons. In my opinion, the input code is simpler and easier to follow.
The command to use is \addlinespace
; you have also a wrong }
:
\begin{threeparttable}
\begin{tabular}{
>{\raggedright}p{3.05cm}
>{\raggedright}p{0.6cm}
>{\raggedright}p{1.5cm}
>{\raggedright}p{2cm}
>{\raggedright}p{1.75cm}
>{\raggedright}p{1.75cm}
>{\raggedright}p{0.25cm}
>{\raggedright}p{2cm}
>{\raggedright}p{1.5cm}
>{\raggedright}p{1.75cm}
>{\raggedright}p{1.75cm}
}
\toprule\addlinespace[\smallskipamount]
However, I don't think that adding such a space is needed.
There are other points where your code can be improved. For example, defining
\newcolumntype{P}[1]{>{\raggedright}p{#1}}
in the preamble, your tabular preamble can be reduced to
\begin{tabular}{
P{3.05cm}
P{0.6cm}
P{1.5cm}
P{2cm}
P{1.75cm}
P{1.75cm}
P{0.25cm}
P{2cm}
P{1.5cm}
P{1.75cm}
>{\arraybackslash}P{1.75cm}
}
so that you're not required to use \tabularnewline
for ending table rows.
The table enclosure can be more simply
\begin{sidewaystable}[htp]
\caption{Key morphological characteristics}
\label{tab:cycadnmorph}
\centering\scriptsize
\begin{threeparttable}
...<the tabular>...
\begin{tablenotes}
\item [a] Data adapted.
\item [b] ND, no data.
\item [c] Accession numbers
\item[d] D
\end{tablenotes}
\end{threeparttable}
\end{sidewaysttable}
Best Answer
Displaying things like this may not be the good idea, but how to do it with LaTeX has answers.