我正在尝试使用多列执行类似 threeparttable 的操作,但我无法让它工作

我正在尝试使用多列执行类似 threeparttable 的操作,但我无法让它工作

再会,

我对 Latex 还不太熟悉,我正在尝试制作一些类似于 threeparttables 但不那么杂乱的表格。我已使用 threeparttables 包含代码,以便让您了解我正在尝试做什么。'Item' 行包含数字 '1 2 3 4 5 6 7'。我想删除字母上标,并在表格注释部分使用 '1 2 3 4 5 6 7' 而不是 'abcdef g'。这样清楚吗?我尝试过使用多列,但最终弄乱了列宽。我显然是个新手。

感谢您的帮助!

 \documentclass{article}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage[online]{threeparttable}

\begin{document}
\begin{table}[htbp]
\begin{threeparttable}
  \centering
  \caption{Add caption}
    \begin{tabular}{rrrrrrrrrr}
    \toprule
    \textbf{Item} &       & \multicolumn{1}{c}{\textbf{1\tnote{a}}} & \multicolumn{1}{c}{\textbf{2\tnote{b}}} & \multicolumn{1}{c}{\textbf{3\tnote{c}}} & \multicolumn{1}{c}{\textbf{4\tnote{d}}} & \multicolumn{1}{c}{\textbf{5\tnote{e}}} & \multicolumn{1}{c}{\textbf{6\tnote{f}}} & \multicolumn{1}{c}{\textbf{7\tnote{g}}} & \multicolumn{1}{c}{\textbf{AVG}} \\
    \midrule
    Site  & \multicolumn{1}{c}{\textbf{N}} &       &       &       &       &       &       &       &  \\
    \textbf{All} & \multicolumn{1}{c}{\textbf{1}} & \multicolumn{1}{c}{\textbf{3}} & \multicolumn{1}{c}{\textbf{5}} & \multicolumn{1}{c}{\textbf{4}} & \multicolumn{1}{c}{\textbf{6}} & \multicolumn{1}{c}{\textbf{7.1}} & \multicolumn{1}{c}{\textbf{8.2}} & \multicolumn{1}{c}{\textbf{9.3}} & \multicolumn{1}{c}{\textbf{10.4}} \\
    East  & \multicolumn{1}{c}{\textbf{1}} & \multicolumn{1}{c}{\textbf{3}} & \multicolumn{1}{c}{\textbf{5}} & \multicolumn{1}{c}{\textbf{4}} & \multicolumn{1}{c}{\textbf{6}} & \multicolumn{1}{c}{\textbf{7.1}} & \multicolumn{1}{c}{\textbf{8.2}} & \multicolumn{1}{c}{\textbf{9.3}} & \multicolumn{1}{c}{\textbf{10.4}} \\
    West & \multicolumn{1}{c}{\textbf{1}} & \multicolumn{1}{c}{\textbf{3}} & \multicolumn{1}{c}{\textbf{5}} & \multicolumn{1}{c}{\textbf{4}} & \multicolumn{1}{c}{\textbf{6}} & \multicolumn{1}{c}{\textbf{7.1}} & \multicolumn{1}{c}{\textbf{8.2}} & \multicolumn{1}{c}{\textbf{9.3}} & \multicolumn{1}{c}{\textbf{10.4}} \\
    \bottomrule
    \end{tabular}
    \begin{tablenotes}
        \item [a] My overall learning experience at this site was:
        \item [b] I understood what was expected of me at this clerkship site.
        \item [c]This clerkship site provided educational experiences that corresponded to the learning objectives.
        \item [d]4 I received sufficient feedback on my performance at this site.
       \item [e] There was always an attending and/or resident available to me at this site.
        \item [f] I was satisfied with the level at which I was included in patient care decisions at this site.
        \item [g] Patients are treated respectfully at this site.
         \end{tablenotes}
         \end{threeparttable}
\end{table}%
\end{document}

答案1

\tnote如果您不想要指数,则不需要添加;在该tablenotes部分中,您可以根据需要标记项目。

您的输入可以简化:所有列都居中,因此请使用c列类型,但第一个列除外,第一个列应左对齐。使用该array包还可以轻松指定列应为粗体。

\documentclass{article}
\usepackage{booktabs}
\usepackage[online]{threeparttable}
\usepackage{array}

\begin{document}
\begin{table}[htbp]

\begin{threeparttable}
\centering
\caption{Add caption}

\begin{tabular}{l *{9}{>{\bfseries}c}}
\toprule
\textbf{Item} &   & 1 & 2 & 3 & 4 &  5  &  6  &  7  & AVG \\
\midrule
Site          & N \\
\textbf{All}  & 1 & 3 & 5 & 4 & 6 & 7.1 & 8.2 & 9.3 & 10.4 \\
East          & 1 & 3 & 5 & 4 & 6 & 7.1 & 8.2 & 9.3 & 10.4 \\
West          & 1 & 3 & 5 & 4 & 6 & 7.1 & 8.2 & 9.3 & 10.4 \\
\bottomrule
\end{tabular}
\begin{tablenotes}\footnotesize
\item[1] My overall learning experience at this site was:

\item[2] I understood what was expected of me at this clerkship site.

\item[3] This clerkship site provided educational experiences that
         corresponded to the learning objectives.

\item[4] I received sufficient feedback on my performance at this site.

\item[5] There was always an attending and/or resident available to me at this site.

\item[6] I was satisfied with the level at which I was included in patient care
         decisions at this site.

\item[7] Patients are treated respectfully at this site.
\end{tablenotes}

\end{threeparttable}

\end{table}

\end{document}

在此处输入图片描述

答案2

我想我肯定是误解了,但是你为什么不能这样做呢?

\documentclass{article}
\usepackage{array,booktabs}
\usepackage[online]{threeparttable}

\begin{document}
  \begin{table}[htbp]
    \begin{threeparttable}
      \centering
      \caption{Add caption}
      \begin{tabular}{r*{9}{>{\bfseries}c}}
        \toprule
        \bfseries Item &       & 1 & 2 & 3 & 4 & 5 & 6 & 7 & AVG \\
        \midrule
         Site  & N &       &       &       &       &       &       &       &  \\
        \bfseries All & 1 & 3 & 5 & 4 & 6 & 7.1 & 8.2 & 9.3 & 10.4 \\
         East  & 1 & 3 & 5 & 4 & 6 & 7.1 & 8.2 & 9.3 & 10.4 \\
         West & 1 & 3 & 5 & 4 & 6 & 7.1 & 8.2 & 9.3 & 10.4 \\
        \bottomrule
      \end{tabular}
      \begin{tablenotes}
        \item [1] My overall learning experience at this site was:
        \item [2] I understood what was expected of me at this clerkship site.
        \item [3] This clerkship site provided educational experiences that corresponded to the learning objectives.
        \item [4] I received sufficient feedback on my performance at this site.
        \item [5] There was always an attending and/or resident available to me at this site.
        \item [6] I was satisfied with the level at which I was included in patient care decisions at this site.
        \item [7] Patients are treated respectfully at this site.
      \end{tablenotes}
    \end{threeparttable}
  \end{table}%
\end{document}

简化表格

答案3

一些改进,使siunitx包中的列宽度相等。此外,使用包,表格注释为脚注大小,标题和表格之间的垂直间距正确caption

 \documentclass{article}
\usepackage{booktabs, caption}
\usepackage{tabularx}
\usepackage[online]{threeparttable}
\usepackage{siunitx}

\begin{document}

\begin{table}[htbp]
\begin{threeparttable}
  \centering
  \caption{Add caption}
    \begin{tabular}{rc*{8}{S}}
   \toprule
\textbf{Item} & \hphantom{0.0} & \textbf{1} & \textbf{2} & \textbf{3} & \textbf{4} & \textbf{5} & \textbf{6} & \textbf{7}& {\textbf{AVG}} \\
\midrule
Site & N & {\hphantom{0.0}}& {\hphantom{0.0}}& {\hphantom{0.0}} & {\hphantom{0.0}} & {\hphantom{0.0}} & & & \\
    \textbf{All} & 1 & 3 & 5 & 4 & 6 & 7.1 & 8.2 & 9.3 & 10.4 \\
    East & 1 & 3 & 5 & 4 & 6 & 7.1 & 8.2 & 9.3 & 10.4 \\
    West & 1 & 3 & 5 & 4 & 6 & 7.1 & 8.2 & 9.3 & 10.4 \\
    \bottomrule
    \end{tabular}
    \begin{tablenotes}\footnotesize\smallskip
        \item [1] My overall learning experience at this site was:
        \item [2] I understood what was expected of me at this clerkship site.
        \item [3]This clerkship site provided educational experiences that corresponded to the learning objectives.
        \item [4] I received sufficient feedback on my performance at this site.
       \item [5] There was always an attending and/or resident available to me at this site.
        \item [6] I was satisfied with the level at which I was included in patient care decisions at this site.
        \item [7] Patients are treated respectfully at this site.
         \end{tablenotes}
         \end{threeparttable}
\end{table}%

\end{document} 

在此处输入图片描述

相关内容