我正在使用 Beamer 演示文稿,考虑到我已经实现的线条样式,是否可以创建这两个表格(我已经创建了两个相同的表格)一个在另一个之上?
代码:
\documentclass{beamer}
\mode<presentation> {
\usetheme{Madrid}
}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{adjustbox}
\usepackage{color}
\usepackage{amsmath}
\usepackage{systeme}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{caption, tabularx}
\usepackage{ragged2e}
\title[Title]{Title}
\author{Name}
\date{\today}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\frametitle{Title}
\tableofcontents
\end{frame}
\section{Section}
\begin{frame}{Table}
\begin{table}[h]
\caption{xxx}
\centering
% \begin{adjustbox}{width=\textwidth,center}
\begin{adjustbox}{center}
\begin{tabular}{ccc}
% \centering
\toprule
\multirow{}{}{X} & \multicolumn{1}{c}{Model1} & \multicolumn{1}{c}{Model2}\\
\midrule
\multirow{}{}{Var1} & \multicolumn{1}{c}{...}
& \multicolumn{1}{c}{...} \\
\multirow{}{}{Var2} & \multicolumn{1}{c}{...}
& \multicolumn{1}{c}{...} \\
\multirow{}{}{Var3} & \multicolumn{1}{c}{...}
& \multicolumn{1}{c}{...} \\
\bottomrule
\end{tabular}
\end{adjustbox}
% \vspace{ - 05 mm}
\label{tab:xxx}
\end{table}
\end{frame}
\end{document}
编辑:我已经尝试过这种方式,但我无法做更多。
答案1
我猜你正在寻找这样的东西:
MWE(最小工作示例)仅关注表格,其特点是:
\documentclass{beamer}
\usetheme{Madrid}
\usepackage{booktabs, multirow}
\begin{document}
\begin{frame}
\frametitle{Table}
\begin{table}
\footnotesize
\caption{xxx}
\label{tab:xxx}
\centering
\begin{tabular}{c cc cc}
\toprule
\multirow{2.4}{*}{X} & \multicolumn{2}{c}{First} & \multicolumn{2}{c}{Second}\\
\cmidrule(r){2-3} \cmidrule(l){4-5}
& Model 1 & Model 2 & Model 1 & Model 2 \\
\midrule
Var1 & ... & ... & ... & ... \\
Var2 & ... & ... & ... & ... \\
Var3 & ... & ... & ... & ... \\
\bottomrule
\end{tabular}
\medskip
\caption{yyyy}
\begin{tabular}{c cc cc}
\toprule
\multirow{2.4}{*}{X} & \multicolumn{2}{c}{First} & \multicolumn{2}{c}{Second}\\
\cmidrule(r){2-3} \cmidrule(l){4-5}
& Model 1 & Model 2 & Model 1 & Model 2 \\
\midrule
Var1 & ... & ... & ... & ... \\
Var2 & ... & ... & ... & ... \\
Var3 & ... & ... & ... & ... \\
\bottomrule
\end{tabular}
\end{table}
\end{frame}
\end{document}