6

I would like to center the second and third columns of this table horizontally to the page, so that the "Structural alloys" and Claddings" would stick out to the left: enter image description here

\documentclass{article}
\usepackage{booktabs, multirow, threeparttable}
\usepackage{siunitx}

\begin{document}
\begin{table}[htpb] \footnotesize
    \centering
    \begin{threeparttable}
        \caption{Material properties of cladding alloys compared to structural alloys at \SI{705}{\celsius}}
        \label{tab:properties}
        \begin{tabular}{rlc}
             \cmidrule[0.08em]{2-3}
            & Material & CTE (\SI{e-3}{\per\celsius}) \\ 
            \cmidrule[0.05em]{2-3}
            \multirow{2}{*}{Structural alloys \bigg\{} & 316H & 18.8 \\
            & 800H & 17.2 \\ 
            \cmidrule[0.05em]{2-3}
            \multirow{3}{*}{Claddings \Bigg\{} & Ni-201 & 15.8  \\ 
            & Hastelloy N & 14.3  \\ 
            & Haynes 242 & 13  \\ 
            \cmidrule[0.08em]{2-3}
        \end{tabular}
    \end{threeparttable}
\end{table}
\end{document}
4

The table will look unbalanced anyway.

You can do it without \multirow; by accepted convention, blank cells mean repeated value.

\documentclass{article}
\usepackage{booktabs, multirow, threeparttable}
\usepackage{siunitx}

\begin{document}

\begin{table}[htpb]
\centering
\begin{threeparttable}

\caption{Material properties of cladding alloys compared 
  to structural alloys at \SI{705}{\celsius}}
\label{tab:properties}

\begin{tabular}{@{}llS[table-format=2.1]@{}}
\toprule
Type & Material & {CTE (\SI{e-3}{\per\celsius})} \\
\midrule
Structural alloy & 316H        & 18.8 \\
                 & 800H        & 17.2 \\
\midrule
Cladding         & Ni-201      & 15.8 \\
                 & Hastelloy N & 14.3 \\
                 & Haynes 242  & 13   \\
\bottomrule
\end{tabular}

\end{threeparttable}

\end{table}

\end{document}

enter image description here

The alternative doesn't look as appealing:

\documentclass{article}
\usepackage{booktabs, multirow, threeparttable}
\usepackage{siunitx}

\begin{document}
\begin{table}[htpb]
    \centering
    \begin{threeparttable}
        \caption{Material properties of cladding alloys compared to structural alloys at \SI{705}{\celsius}}
        \label{tab:properties}
        \begin{tabular}{@{}r@{}lc}
             \cmidrule[0.08em]{2-3}
            & Material & CTE (\SI{e-3}{\per\celsius}) \\ 
            \cmidrule[0.05em]{2-3}
            \multirow{2}{*}{\llap{Structural alloys \bigg\{\ }} & 316H & 18.8 \\
            & 800H & 17.2 \\ 
            \cmidrule[0.05em]{2-3}
            \multirow{3}{*}{\llap{Claddings \Bigg\{\ }} & Ni-201 & 15.8  \\ 
            & Hastelloy N & 14.3  \\ 
            & Haynes 242 & 13  \\ 
            \cmidrule[0.08em]{2-3}
        \end{tabular}
    \end{threeparttable}
\end{table}
\end{document}

enter image description here

3
  • That doesn't give the exact format that I was hoping for, but it's probably the best alternative. – Cedric Eveleigh Jul 1 '17 at 18:14
  • @CedricEveleigh I added the same with the braces; I don't like it at all. – egreg Jul 1 '17 at 19:09
  • Even though the centered one with braces does look funny, thanks for sharing! – Cedric Eveleigh Jul 1 '17 at 21:27
4

Edit: After OP comment below can it seems that he wish that the column with "material" in column head be placed in the middle of text width. This can be achieved by shifting table to the left side. This can be done on many ways ... with use of invisible rule after threeparttable cross my mind as the simplest. Accordingly I corrected my MWE from the first version of answer:

enter image description here

\documentclass{article}
\usepackage{booktabs, multirow, threeparttable}
\usepackage{siunitx}
\newlength\tabshift% added

%-------------------------------------------- to show page layout
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
\begin{table}[htpb] 
    %\footnotesize
    \centering
    \begin{threeparttable}
        \caption{Material properties of cladding alloys compared to structural alloys at \SI{705}{\celsius}}
        \label{tab:properties}
        \begin{tabular}{rlS}
             \cmidrule[0.08em]{2-3}
            & Material & {CTE (\SI{e-3}{\per\celsius})} \\
            \cmidrule[0.05em]{2-3}
            \multirow{2}{*}{Structural alloys \bigg\{} & 316H & 18.8 \\
            & 800H & 17.2 \\
            \cmidrule[0.05em]{2-3}
            \multirow{3}{*}{Claddings \Bigg\{} & Ni-201 & 15.8  \\
            & Hastelloy N & 14.3  \\
            & Haynes 242 & 13  \\
            \cmidrule[0.08em]{2-3}
        \end{tabular}
    \end{threeparttable}%
        \rule{0.5\tabshift}{0pt}% added
\end{table}
\end{document}

The last table column I change to S column type using package siunitx. You can make detailed specification for S column, for example as S[table-format=2.1] (recommended to do). In your particular case the result is the same in the both cases.

Note (1): Please, in future always provide small but complete document (MWE: Minimal (non)Working Example) as I do above. Help people who are willing to help you. it is not fun to write missing preamble ...

Note (2): Please, in future be more accurate in formulating your question :). You receive two answers both based -- regarding your comment below -- on wrong assumption. And by the way, original position of table (before shifting to the left) seems to bi just fine ...

Fine tuning of table positioning you can do with change of factor 0.5 in \rule{0.5\tabshift}{0pt} to value which to your taste place table the best on the page.

Addendum: Form better visual centering of table on page I would redesign your table as follows:

\documentclass{article}
\usepackage{booktabs, makecell, multirow, threeparttable}
\usepackage{siunitx}

%---------------------------------------------------------------%
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
\begin{table}[htpb]
    \centering
    \begin{threeparttable}
        \caption{Material properties of cladding alloys compared to structural alloys at \SI{705}{\celsius}}
        \label{tab:properties}
        \begin{tabular}{rlS}
             \cmidrule[0.08em]{2-3}
            & Material & {CTE (\SI{e-3}{\per\celsius})} \\
            \cmidrule[0.05em]{2-3}
            \multirow{2}{*}{\makecell{Structural\\ alloys} \bigg\{} & 316H & 18.8 \\
            & 800H & 17.2 \\
            \cmidrule[0.05em]{2-3}
            \multirow{3}{*}{Claddings \Bigg\{} & Ni-201 & 15.8  \\
            & Hastelloy N & 14.3  \\
            & Haynes 242 & 13  \\
            \cmidrule[0.08em]{2-3}
        \end{tabular}
    \end{threeparttable}
\end{table}
\end{document}

enter image description here

2
  • I didn't ask my question correctly the first time. I mean to say that I would like to center the second and third columns to the page (right now, the whole table looks as if its off the right). – Cedric Eveleigh Jul 1 '17 at 13:19
  • @CedricEveleigh, see edit of my answer. – Zarko Jul 1 '17 at 14:16
1

I would like to center the second and third columns of this table horizontally

This can be achieved by using c for the required columns at \begin{tabular}{rcc}

1
  • I didn't ask my question correctly the first time. I mean to say that I would like to center the second and third columns to the page (right now, the whole table looks as if its off the right). – Cedric Eveleigh Jul 1 '17 at 13: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.