테이블의 특정 열을 페이지의 가로 가운데에 배치

테이블의 특정 열을 페이지의 가로 가운데에 배치

이 테이블의 두 번째 및 세 번째 열을 페이지의 수평 중앙에 배치하여 "구조적 합금" 및 클래딩"이 왼쪽에 튀어나오도록 하고 싶습니다. 여기에 이미지 설명을 입력하세요

\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}

답변1

어쨌든 테이블은 불균형해 보일 것입니다.

없이도 할 수 있습니다 \multirow. 허용되는 규칙에 따라 빈 셀은 반복되는 값을 의미합니다.

\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}

여기에 이미지 설명을 입력하세요

대안은 그다지 매력적이지 않습니다.

\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}

여기에 이미지 설명을 입력하세요

답변2

편집하다: 아래 OP 댓글을 보면 열 머리글에 "재료"가 있는 열이 텍스트 너비 중간에 배치되기를 바라는 것 같습니다. 이는 테이블을 왼쪽으로 이동하여 수행할 수 있습니다. 이것은 여러 가지 방법으로 수행될 수 있습니다. threeparttable가장 간단한 방법은 마음에 들지 않는 규칙을 사용하는 것입니다 . 따라서 나는 답변의 첫 번째 버전에서 MWE를 수정했습니다.

여기에 이미지 설명을 입력하세요

\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}

Spackage 를 사용하여 열 유형 으로 변경한 마지막 테이블 열입니다 siunitx. 예를 들어 (권장) S과 같이 열에 대한 세부 사양을 작성할 수 있습니다 . S[table-format=2.1]귀하의 특별한 경우에는 두 경우 모두 결과가 동일합니다.

참고(1): 앞으로도 위와 같이 항상 작지만 완전한 문서(MWE: Minimal (non)Working example)를 제공해 주시기 바랍니다. 당신을 기꺼이 도와줄 사람들을 도와주세요. 빠진 서문을 쓰는건 재미가 없군요...

노트 2): 앞으로는 질문을 좀 더 정확하게 작성해 주세요 :). 아래 귀하의 의견과 관련하여 잘못된 가정을 바탕으로 두 가지 답변을 받았습니다. 그런데 테이블의 원래 위치(왼쪽으로 이동하기 전)는 괜찮은 것 같습니다...

0.5요소를 변경하여 테이블 위치를 미세 조정 하여 \rule{0.5\tabshift}{0pt}취향에 따라 페이지에서 테이블을 가장 잘 배치할 수 있습니다 .

부록: 페이지에서 테이블의 시각적 중심을 더 잘 지정하려면 다음과 같이 테이블을 다시 디자인해야 합니다.

\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}

여기에 이미지 설명을 입력하세요

답변3

이 테이블의 두 번째와 세 번째 열을 가로 중앙에 배치하고 싶습니다.

c이는 다음에서 필요한 열을 사용하여 달성할 수 있습니다 .\begin{tabular}{rcc}

관련 정보