1

I am new in LaTeX. Could the headings of a LaTeX table to be set bottom aligned, and the other cells top aligned? This feature is important for the revisions according to my school standards, and I'm writing a template for any table.

I have set the horizontal alignment already. Constraints: The table could to extend by several pages (so, I am using longtable package). The footnotes must to be as the below image (adjacent to the last row, and in a line or runin, so I am using threeparttablex package). Height of rows variable (according to text length). Width of columns constant, different between each column. Wider column position is arbitrary. Compatible with spanish and french babel. Horizontal lines only for the first row (heading, top and bottom), and at the bottom of last row. It must to let use of multirow and multicolumn packages.

I have checked similar posts here and I have looked for several days in Internet, but I have not could to set the table.

Here, my code:

\documentclass[letterpaper,12pt, oneside]{report}
\usepackage[spanish,french]{babel}
\usepackage{longtable,tabularx,ltxtable}
\usepackage{titletoc}
\usepackage{booktabs}
\usepackage[para]{threeparttablex}
\usepackage{array,ragged2e}
\usepackage{rotating}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} % left columns
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} % centered columns
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}} % right columns
\begin{document}
\vspace{-1cm}
\begingroup
\linespread{1.3}
\begin{ThreePartTable}
\begin{longtable} {C{3.5cm}  L{4.5cm} L{6cm}}
\toprule
\Centering{Material Type} & \Centering{Uses} & \Centering{Technical \newline Recommendations} %
\\ \midrule
\endhead
\cmidrule{1-3}
\multicolumn{2}{r}{\textit{continued}}
\endfoot
\bottomrule
\insertTableNotes
\endlastfoot
Solid wood & Boards, moldings;\newline unfinished or preprimed & If budget permits, choose vertical-grain lumber of decay-resistant 
species.\newline Prime all faces and cut edges.\tnote{a} \\
Finger-jointed & Boards, moldings;\newline unfinished or preprimed & Prime all faces and cut edges. Maintain finish.\tnote{b}\\
\end{longtable}
\vspace{-1cm}
\footnotesize{
\begin{tablenotes}
\item[a] With grain
\item[b] Across grain
\end{tablenotes}
}
\end{ThreePartTable}
\endgroup
\end{document}

enter image description here

Excuse me by my English.

1
  • Perhaps if you add what you have tried so far, we will be able to help you more. Welcome to TeX.SE. – Masroor Jan 11 '15 at 15:16
1

The simplest is to use the makecell package, which allows for a common formatting, control on the vertical and horizontal alignment and line breaks in certain cells with the theadand makecell commands:

\documentclass[letterpaper,12pt, oneside]{report}
\usepackage[spanish,french]{babel}
\usepackage{longtable,tabularx,ltxtable}
\usepackage{titletoc}
\usepackage{booktabs}
\usepackage[para]{threeparttablex}
\usepackage{array,ragged2e}
\usepackage{rotating}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} % left columns
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} % centered columns
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}} % right columns
\usepackage{makecell}
\renewcommand\theadalign{bc}
\renewcommand\theadfont{\normalsize}

\begin{document}
\vspace{-1cm}

\begingroup
\linespread{1.3}
\begin{ThreePartTable}
\begin{longtable} {C{3.5cm} L{4.5cm} L{6cm}}
\toprule
\thead{Material Type} & \thead{Uses} & \thead{Technical \\ Recommendations} %
\\ \midrule
\endhead
\cmidrule{1-3}
\multicolumn{2}{r}{\textit{continued}}
\endfoot
\bottomrule
\insertTableNotes
\endlastfoot
Solid wood & Boards, moldings;\newline unfinished or preprimed & If budget permits, choose vertical-grain lumber of decay-resistant
species.\newline Prime all faces and cut edges.\tnote{a} \\
Finger-jointed & Boards, moldings;\newline unfinished or preprimed & Prime all faces and cut edges. Maintain finish.\tnote{b}\\
\end{longtable}
\vspace{-1cm}
\footnotesize{
\begin{tablenotes}
\item[a] With grain
\item[b] Across grain
\end{tablenotes}
}
\end{ThreePartTable}
\endgroup

\end{document} 

enter image description here

2
  • Dear Bernard, You have solved my LaTeX problem easyly and quickly . Thank you very much. – Jh0an1 Uzca73gu1 Jan 11 '15 at 17:55
  • You're welcome. Glad to have been helpful. – Bernard Jan 11 '15 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.