[Tex/LaTex] longtable with multiline column

longtablemulticolumnvertical alignment

I'm trying to make longtables (that can span pages) with a column containing a newline, and another column that contains a paragraph. My attempts so far all have vertical alignment issues whereby these two columns don't top-align with each other. The table below shows those issues.

This text is being created programatically so I'd love to get the formatting right on a small example and replicate that in my code. I'm not wedded to the \pbox implementation I've got either – I'd love to take suggestions of a better choice.

enter image description here

\documentclass[a4paper]{article}
% All packages included for context
\usepackage[margin=1.5in]{geometry}
\usepackage{hyperref}
\usepackage{apacite}
\usepackage{natbib}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[capitalise,noabbrev]{cleveref}
\usepackage{floatrow}
\usepackage{subcaption}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{multicol}
\usepackage{fixltx2e}
\usepackage{pbox}
\usepackage{makecell}
\floatsetup[table]{capposition=top}
\begin{document}
\begin{longtable}
{llp{8cm}}
\toprule
Name  & Units  & Description  \\ \midrule
\pbox[c]{5cm}{perimarea\\\textbf{Outer X-sectional Area}} & $mm^2$ & Notice that this description and the units column aren't nicely aligned with the top of the cell? I'd like to bring it up to align with the ``perimarea'' text). \\
\pbox[c]{5cm}{innerarea\\\textbf{Inner X-sectional Area}} & $mm^2$ & This one too, but it's a short description. \\
\pbox[c]{5cm}{shortname\\\textbf{Linked with long name}} & $mm^2$ & Also, notice when this ``description'' is just 1 line... \\
\pbox[c]{5cm}{normallineX\\\textbf{Bold Line X}} & $mm^2$ & ... how the two ``Name'' lines sort of overlap? \\
\pbox[c]{5cm}{normallineY\\\textbf{Bold Line Y}} & $mm^2$ & I'd like to nudge the spacing in the ``Name'' column to make it clearer that ``normallineX'' and \textbf{Bold Line X} are associated with each other rather than having \textbf{Bold Line X} look like it's associated with ``normallineY'' from the cell \textit{below} \\
\bottomrule
\end{longtable}

Best Answer

enter image description here

\documentclass[a4paper]{article}
% All packages included for context
\usepackage[margin=1.5in]{geometry}
\usepackage{hyperref}
\usepackage{apacite}
\usepackage{natbib}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[capitalise,noabbrev]{cleveref}
\usepackage{floatrow}
\usepackage{subcaption}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{multicol}
\usepackage{fixltx2e}
\usepackage{array}
\usepackage{makecell}
\floatsetup[table]{capposition=top}
\begin{document}
\newcommand{\mmsq}{$\mathrm{mm}^2$}
\setlength\extrarowheight{5pt}
\begin{longtable}
{@{}>{\raggedright}p{4.2cm}lp{7.3cm}@{}}
\toprule
\multicolumn{1}{c}{Name}&
\multicolumn{1}{c}{Units}&
\multicolumn{1}{c}{Description}\\ \midrule
perimarea

\textbf{Outer X-sectional Area} &
   \mmsq &
   Notice that this description and the units column aren't nicely aligned with the top of the cell? I'd like to bring it up to align with the ``perimarea'' text). \\
innerarea

\textbf{Inner X-sectional Area} &
   \mmsq &
   This one too, but it's a short description. \\
shortname

\textbf{Linked with long name} &
   \mmsq &
   Also, notice when this ``description'' is just 1 line... \\
normallineX

\textbf{Bold Line X} &
   \mmsq &
   ... how the two ``Name'' lines sort of overlap? \\
normallineY

\textbf{Bold Line Y} &
   \mmsq &
   I'd like to nudge the spacing in the ``Name'' column to make it clearer that ``normallineX'' and \textbf{Bold Line X} are associated with each other rather than having \textbf{Bold Line X} look like it's associated with ``normallineY'' from the cell \textit{below} \\
\bottomrule
\end{longtable}

\end{document}
Related Question