如何在表格末尾添加新列?

如何在表格末尾添加新列?

有人可以告诉我如何在表格末尾添加新列吗?

\documentclass[11pt]{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{babel}
\usepackage{mathtools,amssymb}
\usepackage{booktabs, makecell, 
            threeparttable}       % <---
\setlength\heavyrulewidth{2pt}    % <---
\setlength\lightrulewidth{1.2pt}  % <---

\setcellgapes{3pt}
\renewcommand\theadfont{\normalsize\bfseries}
\renewcommand\theadgape{}

\usepackage{isotope}
\usepackage[table]{xcolor}
\arrayrulecolor{teal}
\usepackage[skip=0.5ex]{caption}
    \DeclareCaptionLabelFormat{uc}{\MakeUppercase{#1}~#2}                % <===
    \DeclareCaptionFont{teal}{\color{teal}\fontfamily{iwona}\selectfont} % <===
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\usepackage{booktabs}
%\usepackage[flushleft]{threeparttable} % <---
\usepackage{dcolumn}
\newcolumntype{d}[1]{D{.}{.}{#1}}
\begin{document}

\begin{table}[ht] \centering
\begin{threeparttable}
\renewcommand\thetable{3}
\caption{XXXXXXXXXXX XXXXXXX XXXXXXXXX XXXXXXXX XXXXXXXX}

\begin{tabular}{ l d{3.1} d{1.1} }
\toprule
\multicolumn{1}{c}{XXXXXXX XXXXX}
&\multicolumn{1}{c}{XXXX XXXXXX}
&\multicolumn{1}{c}{XX\(^a\)}\\
\midrule
  
XXX & 8.2 & 1.2  \\
  
XXX & 305.2 & 1.1  \\

XXXXX & 189.3 & 0.6 \\

XXXX & 62.3 & 0.1 \\
 
XXXX XXXX & 2.3  & 0.4 \\

XXXXX XXXXX & 39.5 & 1.2 \\
  
XXX  & 0.3 & 1.2 \\

XXXXXX XXXXXXXX & 9.2 & 0.9 \\

XXXXXXXX & 8.9 & 1.4 \\
    \midrule
\multicolumn{1}{c}{XXXXX XXXX} \\
\cmidrule{1-1}

XXXXXXX & 9.2 & 0.5 \\
XXXXXX XXXXXX XXXXXXXX 90 & 562.3 & 2 \\
XXXX XXXXX XXXXXX 10 & 98.2 & 1.2 \\
XX XXXXXXX XXXXXXX 30 & 1.9 & 0.1 \\
XXXXXX XXXXX 10 & 90.3 & 1.5 \\
XXXXX XXXXXXX 20 & 9.8 & 1.9 \\
    \bottomrule
\end{tabular}

\begin{tablenotes}[para]    % <---

\(^a\)XX = XXXXX XXXXXXXXX
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document} 

答案1

据我所知,这就是你要找的东西:

\documentclass[11pt]{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{babel}
\usepackage{mathtools,amssymb}
\usepackage{booktabs, makecell, 
            threeparttable}       % <---
\setlength\heavyrulewidth{2pt}    % <---
\setlength\lightrulewidth{1.2pt}  % <---

\setcellgapes{3pt}
\renewcommand\theadfont{\normalsize\bfseries}
\renewcommand\theadgape{}

\usepackage{isotope}
\usepackage[table]{xcolor}
\arrayrulecolor{teal}
\usepackage[skip=0.5ex]{caption}
    \DeclareCaptionLabelFormat{uc}{\MakeUppercase{#1}~#2}                % <===
    \DeclareCaptionFont{teal}{\color{teal}\fontfamily{iwona}\selectfont} % <===
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\usepackage{booktabs}
%\usepackage[flushleft]{threeparttable} % <---
\usepackage{dcolumn}
\newcolumntype{d}[1]{D{.}{.}{#1}}
\begin{document}

\begin{table}[ht] \centering
\begin{threeparttable}
\renewcommand\thetable{3}
\caption{XXXXXXXXXXX XXXXXXX XXXXXXXXX XXXXXXXX XXXXXXXX}

\begin{tabular}{ l r r r}
\toprule
\multicolumn{1}{c}{XXXXXXX XXXXX}
&\multicolumn{1}{c}{XXXX XXXXXX}
&\multicolumn{1}{c}{XX\(^a\)}
&\multicolumn{1}{c}{XX\(^{a+1}\)}\\
\midrule
  
XXX & 8.2 & 1.2 & 1.2+1 \\
  
XXX & 305.2 & 1.1 & 1.1+1 \\

XXXXX & 189.3 & 0.6 & 0.6+1\\

XXXX & 62.3 & 0.1 &0.1+1\\
 
XXXX XXXX & 2.3 & 0.4 & 0.4+1\\

XXXXX XXXXX & 39.5 & 1.2 & 1.2+1\\
  
XXX  & 0.3 & 1.2 & 1.2+1\\

XXXXXX XXXXXXXX & 9.2 & 0.9 & 0.9+1\\

XXXXXXXX & 8.9 & 1.4 & 1.4+1\\
    \midrule
\multicolumn{1}{c}{XXXXX XXXX} \\
\cmidrule{1-1}

XXXXXXX & 9.2 & 0.5 & 0.5+1\\
XXXXXX XXXXXX XXXXXXXX 90 & 562.3 & 2 & 2+1\\
XXXX XXXXX XXXXXX 10 & 98.2 & 1.2 & 1.2+1\\
XX XXXXXXX XXXXXXX 30 & 1.9 & 0.1 & 0.1+1\\
XXXXXX XXXXX 10 & 90.3 & 1.5 & 1.5+1\\
XXXXX XXXXXXX 20 & 9.8 & 1.9 & 1.9+1\\
    \bottomrule
\end{tabular}

\begin{tablenotes}[para]    % <---

\(^a\)XX = XXXXX XXXXXXXXX
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document} 

未来注意事项:既然没有人会窃取您的成果,您就应该避免写出Xs您真正想要在文档中显示的内容。
将来,可能有人需要您要求的相同内容,他们可以轻松地在搜索栏中找到它 :D 祝
您有美好的一天!

相关内容