테이블 고치는 데 도움을 주세요

테이블 고치는 데 도움을 주세요

좀 더 숫자가 많은 테이블에 잘 작동하는 템플릿을 사용해 보았지만 이를 새로운 요구 사항에 맞게 조정하려고 괴물을 만들었습니다. 여기 mwe가 있습니다:

\documentclass[a4paper, 11pt]{scrreprt}
\usepackage{amsmath,booktabs,siunitx}
\usepackage[version=4]{mhchem}  
\sisetup{separate-uncertainty}

\newcommand{\tabhead}[1]{%
    \smash[b]{%
        \begin{tabular}[t]{@{}c@{}}#1\end{tabular}%
    }%
}

\begin{document}

\begin{table}[h]

    \caption{Caption here.}\label{whatever}

    \setlength{\tabcolsep}{0pt}

    \begin{tabular*}{\linewidth}{
            @{\extracolsep{\fill}}
            r
            S[table-format=2.1]
            r
            S[table-format=1.2]
            r
            S[table-format=4.0]
            r
            r
        }
        \toprule
        {\textbf{Material} } &
        {\tabhead{ \textbf{Mean Pore Radius} \\ \textbf{(\si{\nano\meter})}}} &
        { \textbf{Model}} &
        {\tabhead{\textbf{Salt Concentration} \\ \textbf{({M} \ce{NaCl})}}} &
        {\textbf{pH}} &
        {\textbf{Buffer}} &
        {\tabhead{Range of Dextrans \\ \textbf{(kDa)}}} &
        {\tabhead{Reference \\ \textbf{(--)}}} \\
        &&&  \\
        \midrule
        LongName AA         &   18.4 & Simple model   &   0   & 20 mM Bis-Tris          &   6.5     &   0.18 to 500      &  [1,2]   \\ 
        LongName AA         &   25.8 & complex model  & 0.12  &  10 mM Tris-\ce{HCl}    &   7.2     & 0.18 to 20000      &  [3] \\  
        AA LongName  AA     &   15.0 & complex model  & 1     &  10 mM phosphate        &   8.0     &  4 to 400          &  [4,2]\\ 

        \bottomrule
    \end{tabular*}
    \label{}

\end{table}

\end{document}

오류 없이 컴파일되지만 한편으로는 페이지에 맞지 않아 전체 테이블을 볼 수 없으며 다음과 같은 다른 잘못된 사항도 많이 있습니다.

  • 헤더가 겹칩니다. 제목 사이에 적절한 거리가 없습니다.
  • 요소를 오른쪽 정렬하고 헤더를 중앙에 정렬하는 방법은 무엇입니까?
  • 이 상황에서 tabularx를 사용해야 합니까?

도움을 주시면 감사하겠습니다!

답변1

긴 헤더를 페이지 제한에 맞출 희망은 거의 없습니다. 표 바로 아래(또는 아마도 캡션에) 설명되어 있는 약어를 사용하는 것이 좋습니다.

\documentclass[a4paper, 11pt]{scrreprt}
\usepackage{amsmath,booktabs,siunitx}
\usepackage[version=4]{mhchem}  
\sisetup{separate-uncertainty}

\begin{document}

\begin{table}[htp]

\caption{Caption here.}\label{whatever}

\setlength{\tabcolsep}{0pt}

\footnotesize

\begin{tabular*}{\linewidth}{
  @{\extracolsep{\fill}}
  l
  S[table-format=2.1]
  l
  S[table-format=1.2]
  l
  S[table-format=1.1]
  l
  r
}
\toprule
\textbf{Material} & {\textbf{MPR}} & \multicolumn{1}{c}{\textbf{Model}} & {\textbf{SC}} &
\multicolumn{1}{c}{\textbf{pH}} & {\textbf{B}} & \textbf{RD} & \textbf{Ref.} \\
\midrule
LongName AA    & 18.4 & Simple model  & 0    & 20 mM Bis-Tris      & 6.5 & 0.18 to 500   &  [1,2] \\ 
LongName AA    & 25.8 & complex model & 0.12 & 10 mM Tris-\ce{HCl} & 7.2 & 0.18 to 20000 &  [3] \\  
AA LongName AA & 15.0 & complex model & 1    & 10 mM phosphate     & 8.0 & 4 to 400      &  [4,2] \\ 
\midrule[\heavyrulewidth]
\end{tabular*}
\begin{tabular*}{\textwidth}[t]{@{\extracolsep{\fill}}lll}
MPR: Mean Pore Radius (\si{\nano\meter}) &
SC: Salt Concentration (M \ce{NaCl}) &
B: Buffer \\
RD: Range of Dextrans (kDa) & Ref.: Reference
\end{tabular*}

\end{table}

\end{document}

\footnotesize기둥이 없으면 너무 압착될 것입니다. 텍스트 너비에 따라 \small할 수 있습니다.

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

관련 정보