Ayuda para arreglar una mesa.

Ayuda para arreglar una mesa.

Intenté usar una plantilla que funciona bien para una tabla más numérica pero creé un monstruo tratando de adaptarla a las nuevas necesidades. Aquí está el 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}

Se compila sin errores pero por un lado no cabe en la página por lo que no puedo ver la tabla completa, y hay otras muchas cosas incorrectas como:

  • los encabezados se superponen. No hay una distancia adecuada entre los títulos.
  • ¿Cómo ordenar los elementos justificados a la derecha pero centrando el encabezado?
  • ¿Debería usar tabularx en esta situación?

¡Cualquier ayuda es apreciada!

Respuesta1

Hay pocas esperanzas de que esos encabezados largos se ajusten al límite de páginas. Sugiero utilizar acrónimos que se explican justo debajo de la tabla (o quizás en el título).

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

Sin \footnotesizelas columnas estaría demasiado apretado. Dependiendo del ancho del texto, \smallpodría funcionar.

ingrese la descripción de la imagen aquí

información relacionada