我有一个表格,里面有太多的列,我不想以横向显示它。所以我的想法是切断一些列,在下面创建一个新表格。现在我想让上面的(较长的)表格在页面上居中,而下面的表格与上面的表格左对齐。我尝试将它们都放入居中的小页面中,并在这个小页面中将它们对齐到左侧。但这似乎不起作用,所以我没有解决方案。
这是我的代码(抱歉没有澄清序言)。
\documentclass[12pt]{article}
\usepackage{mathptmx}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}
\usepackage{array}
\usepackage{float}
\usepackage{booktabs}
\usepackage{textcomp}
\usepackage{amssymb}
\makeatletter
\providecommand{\tabularnewline}{\\}
\@ifundefined{date}{}{\date{}}
\usepackage[colorlinks,
pdfpagelabels,
pdfstartview = FitH,
bookmarksopen = true,
bookmarksnumbered = true,
linkcolor = black,
plainpages = false,
hypertexnames = false,
citecolor = black] {hyperref}
\usepackage{tikz,pgf,pgfplots}
\usepackage{mathrsfs}
\usetikzlibrary{shapes.geometric,patterns,calc,matrix,arrows.meta}
\setlength{\parindent}{0pt}
\usepackage{amsthm}
\usepackage{wrapfig}
\setlength\parindent{0pt}
\definecolor{myblue}{RGB}{0,56,101}
\definecolor{mygreen}{RGB}{106,176,35}
\definecolor{tablegreen}{RGB}{224,239,212}
\definecolor{tableyellow}{RGB}{255,251,204}
\definecolor{tablered}{RGB}{252,212,209}
\usepackage{colortbl,dcolumn}
\def\zz#1{%
\ifdim#1pt<0.5pt\cellcolor{tablered}\else
\ifdim#1pt<1pt\cellcolor{tableyellow}\else
\cellcolor{tablegreen}\fi\fi
#1}
\makeatother
\usepackage{babel}
\begin{document}
\begin{table}[H]
\begin{raggedright}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|}
\hline
& EK1 & EK2-1 & EK2-2 & EK2-3 & EK3-1 & EK3-2 & EK4 & EK5-1\tabularnewline
\hline
\hline
A & \zz{1} & \zz{1} & \zz{0.5} & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & \zz{1}\tabularnewline
\hline
B & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & \zz{1} & \zz{1}\tabularnewline
\hline
C & \zz{0} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1}\tabularnewline
\hline
D & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & \zz{1} & \zz{1}\tabularnewline
\hline
E & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & \zz{1} & \zz{1}\tabularnewline
\hline
F & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1}\tabularnewline
\hline
G & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1}\tabularnewline
\hline
H & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{0} & \zz{1} & \zz{1}\tabularnewline
\hline
I & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1}\tabularnewline
\hline
mean values & 0.89 & 1 & 0.94 & 1 & 1 & 0.72 & 0.94 & 1\tabularnewline
\hline
\end{tabular}
\par\end{raggedright}
\vspace{0.5cm}
\begin{raggedright}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
& EK5-2 & EK5-3 & EK6-1 & EK6-2 & mean values\tabularnewline
\hline
\hline
A & \zz{1} & \zz{0} & \zz{1} & \zz{0} & 0.75\tabularnewline
\hline
B & \cellcolor{tablered} & \zz{0.5} & \zz{1} & \zz{0} & 0.82\tabularnewline
\hline
C & \zz{1} & \zz{0} & \zz{1} & \zz{0.5} & 0.79\tabularnewline
\hline
D & \zz{1} & \zz{1} & \zz{1} & \zz{1} & 0.96\tabularnewline
\hline
E & \zz{0.5} & \zz{1} & \zz{0.5} & \zz{0.5} & 0.83\tabularnewline
\hline
F & \zz{1} & \zz{0.5} & \zz{1} & \zz{0.5} & 0.92\tabularnewline
\hline
G & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & 0.96\tabularnewline
\hline
H & \zz{1} & \zz{1} & \zz{1} & \zz{1} & 0.92\tabularnewline
\hline
I & \zz{1} & \zz{1} & \zz{1} & \zz{1} & 1\tabularnewline
\hline
mean values & 0.94 & 0.67 & 0.94 & 0.56 & \tabularnewline
\hline
\end{tabular}
\par\end{raggedright}
\centering{}\caption{example table}
\end{table}
答案1
将两种tabular
环境合并在一起minipage
绝对是可行的方法。
我还要确保所有数据列的宽度都相同。
\documentclass[12pt]{article}
\usepackage{mathptmx}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\geometry{verbose,margin=2cm}
\usepackage{array}
\usepackage{float}
\usepackage{booktabs}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{tikz,pgf,pgfplots}
\usepackage{mathrsfs}
\usetikzlibrary{shapes.geometric,patterns,calc,matrix,arrows.meta}
\setlength{\parindent}{0pt}
\usepackage{amsthm}
\usepackage{wrapfig}
\setlength\parindent{0pt}
\definecolor{myblue}{RGB}{0,56,101}
\definecolor{mygreen}{RGB}{106,176,35}
\definecolor{tablegreen}{RGB}{224,239,212}
\definecolor{tableyellow}{RGB}{255,251,204}
\definecolor{tablered}{RGB}{252,212,209}
\usepackage{colortbl,dcolumn}
\def\zz#1{%
\ifdim#1pt<0.5pt\cellcolor{tablered}\else
\ifdim#1pt<1pt\cellcolor{tableyellow}\else
\cellcolor{tablegreen}\fi\fi
#1}
\usepackage[english]{babel}
\usepackage[colorlinks,
pdfpagelabels,
pdfstartview = FitH,
bookmarksopen = true,
bookmarksnumbered = true,
hypertexnames = false,
linkcolor = black,
plainpages = false,
citecolor = black] {hyperref}
\newlength\mylength
\settowidth\mylength{EK6-2}
\begin{document}
\begin{table}[ht!]
%\begin{raggedright}
\centering
\begin{minipage}{0.87\textwidth}
\begin{tabular}{ |c| *{8}{wc{\mylength}|} }
\hline
& EK1 & EK2-1 & EK2-2 & EK2-3 & EK3-1 & EK3-2 & EK4 & EK5-1\\
\hline
\hline
A & \zz{1} & \zz{1} & \zz{0.5} & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & \zz{1}\\
\hline
B & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & \zz{1} & \zz{1}\\
\hline
C & \zz{0} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1}\\
\hline
D & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & \zz{1} & \zz{1}\\
\hline
E & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & \zz{1} & \zz{1}\\
\hline
F & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1}\\
\hline
G & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1}\\
\hline
H & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{0} & \zz{1} & \zz{1}\\
\hline
I & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1}\\
\hline
mean values & 0.89 & 1 & 0.94 & 1 & 1 & 0.72 & 0.94 & 1\\
\hline
\end{tabular}
\vspace{0.5cm}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
& EK5-2 & EK5-3 & EK6-1 & EK6-2 & mean values\\
\hline
\hline
A & \zz{1} & \zz{0} & \zz{1} & \zz{0} & 0.75\\
\hline
B & \cellcolor{tablered} & \zz{0.5} & \zz{1} & \zz{0} & 0.82\\
\hline
C & \zz{1} & \zz{0} & \zz{1} & \zz{0.5} & 0.79\\
\hline
D & \zz{1} & \zz{1} & \zz{1} & \zz{1} & 0.96\\
\hline
E & \zz{0.5} & \zz{1} & \zz{0.5} & \zz{0.5} & 0.83\\
\hline
F & \zz{1} & \zz{0.5} & \zz{1} & \zz{0.5} & 0.92\\
\hline
G & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & 0.96\\
\hline
H & \zz{1} & \zz{1} & \zz{1} & \zz{1} & 0.92\\
\hline
I & \zz{1} & \zz{1} & \zz{1} & \zz{1} & 1\\
\hline
mean values & 0.94 & 0.67 & 0.94 & 0.56 & \\
\hline
\end{tabular}
\end{minipage}
\caption{example table}
\end{table}
\end{document}
答案2
使用包装器tabular
:
\documentclass[12pt]{article}
\usepackage{geometry}
\usepackage{mathptmx}
\usepackage{colortbl}
\usepackage{array}
\usepackage[
colorlinks,
pdfpagelabels,
pdfstartview = FitH,
bookmarksopen = true,
bookmarksnumbered = true,
linkcolor = black,
plainpages = false,
hypertexnames = false,
citecolor = black
]{hyperref}
\geometry{
%verbose,
tmargin=2cm,
bmargin=2cm,
lmargin=2cm,
rmargin=2cm
}
\definecolor{myblue}{RGB}{0,56,101}
\definecolor{mygreen}{RGB}{106,176,35}
\definecolor{tablegreen}{RGB}{224,239,212}
\definecolor{tableyellow}{RGB}{255,251,204}
\definecolor{tablered}{RGB}{252,212,209}
\newlength{\colwidth}
\newcommand\ccell[1]{%
\ifdim#1pt<0.5pt\cellcolor{tablered}\else
\ifdim#1pt<1pt\cellcolor{tableyellow}\else
\cellcolor{tablegreen}\fi\fi
#1%
}
\newcolumntype{K}{w{c}{\colwidth}}
\begin{document}
\begin{table}[htp]
\centering
\settowidth{\colwidth}{EK0-0}
\begin{tabular}{@{}l@{}}
\begin{tabular}{|c|*{8}{ K| }}
\hline
& EK1 & EK2-1 & EK2-2 & EK2-3 & EK3-1 & EK3-2 & EK4 & EK5-1\\
\hline
\hline
A & \ccell{1} & \ccell{1} & \ccell{0.5} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{0.5} & \ccell{1}\\
\hline
B & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{0.5} & \ccell{1} & \ccell{1}\\
\hline
C & \ccell{0} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1}\\
\hline
D & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{0.5} & \ccell{1} & \ccell{1}\\
\hline
E & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{0.5} & \ccell{1} & \ccell{1}\\
\hline
F & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1}\\
\hline
G & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1}\\
\hline
H & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{0} & \ccell{1} & \ccell{1}\\
\hline
I & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1}\\
\hline
mean values & 0.89 & 1 & 0.94 & 1 & 1 & 0.72 & 0.94 & 1\\
\hline
\end{tabular}
\\
\noalign{\vspace{0.5cm}}
\begin{tabular}{|c|*{4}{K|}c|}
\hline
& EK5-2 & EK5-3 & EK6-1 & EK6-2 & mean values\\
\hline
\hline
A & \ccell{1} & \ccell{0} & \ccell{1} & \ccell{0} & 0.75\\
\hline
B & \cellcolor{tablered} & \ccell{0.5} & \ccell{1} & \ccell{0} & 0.82\\
\hline
C & \ccell{1} & \ccell{0} & \ccell{1} & \ccell{0.5} & 0.79\\
\hline
D & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & 0.96\\
\hline
E & \ccell{0.5} & \ccell{1} & \ccell{0.5} & \ccell{0.5} & 0.83\\
\hline
F & \ccell{1} & \ccell{0.5} & \ccell{1} & \ccell{0.5} & 0.92\\
\hline
G & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{0.5} & 0.96\\
\hline
H & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & 0.92\\
\hline
I & \ccell{1} & \ccell{1} & \ccell{1} & \ccell{1} & 1\\
\hline
mean values & 0.94 & 0.67 & 0.94 & 0.56 & \\
\hline
\end{tabular}
\end{tabular}
\caption{example table}
\end{table}
\end{document}
我改了\zz
一个更好听的名字。
诀窍是使用 来\noalign{\vspace{0.5cm}}
分隔两行。
我还建议如何获得等宽的列。
答案3
诚然,这个答案并不关注如何实现所要求的对齐,而是更多地关注如何确保整个表格适合可用空间而无需将其切成两半的根本问题:
\documentclass[12pt]{article}
\usepackage{mathptmx}
\usepackage{geometry}
\geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}
\usepackage[table]{xcolor}
\definecolor{tablegreen}{RGB}{224,239,212}
\definecolor{tableyellow}{RGB}{255,251,204}
\definecolor{tablered}{RGB}{252,212,209}
\makeatletter
\def\zz#1{%
\ifdim#1pt<0.5pt\cellcolor{tablered}\else
\ifdim#1pt<1pt\cellcolor{tableyellow}\else
\cellcolor{tablegreen}\fi\fi
#1}
\makeatother
\usepackage{array}
\usepackage{makecell}
\usepackage{calc}
\usepackage[column=0]{cellspace}
\setlength{\cellspacetoplimit}{\tabcolsep}
\setlength{\cellspacebottomlimit}{\tabcolsep}
\begin{document}
\begin{table}
\centering
\small
\setlength{\tabcolsep}{3.15pt}
\begin{tabular}{|c|*{12}{0{wc{\widthof{EK3-1}}}|}c|}
\hline
& EK1 & EK2-1 & EK2-2 & EK2-3 & EK3-1 & EK3-2 & EK4 & EK5-1 & EK5-2 & EK5-3 & EK6-1 & EK6-2 & \makecell{mean\\ values}\tabularnewline
\hline
\hline
A & \zz{1} & \zz{1} & \zz{0.5} & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & \zz{1} & \zz{1} & \zz{0} & \zz{1} & \zz{0} & 0.75\tabularnewline
\hline
B & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & \zz{1} & \zz{1} & \cellcolor{tablered} & \zz{0.5} & \zz{1} & \zz{0} & 0.82\tabularnewline
\hline
C & \zz{0} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{0} & \zz{1} & \zz{0.5} & 0.79\tabularnewline
\hline
D & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & 0.96\tabularnewline
\hline
E & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & \zz{1} & \zz{1} & \zz{0.5} & \zz{1} & \zz{0.5} & \zz{0.5} & 0.83\tabularnewline
\hline
F & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & \zz{1} & \zz{0.5} & 0.92\tabularnewline
\hline
G & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & 0.96\tabularnewline
\hline
H & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{0} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & 0.92\tabularnewline
\hline
I & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & 1\tabularnewline
\hline
\makecell{mean\\ values} & 0.89 & 1 & 0.94 & 1 & 1 & 0.72 & 0.94 & 1 & 0.94 & 0.67 & 0.94 & 0.56 & \tabularnewline
\hline
\end{tabular}
\caption{example table}
\end{table}
\end{document}
答案4
\usepackage[document]{ragged2e}
使用我放置的\begin{center}
并\end{center}
在每个之前居中\begin{tabular}
。
看看我的代码版本:
\documentclass[12pt]{article}
\usepackage{mathptmx}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}
\usepackage{array}
\usepackage{float}
\usepackage{booktabs}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage[document]{ragged2e}
\makeatletter
\providecommand{\tabularnewline}{\\}
\@ifundefined{date}{}{\date{}}
\usepackage[colorlinks,
pdfpagelabels,
pdfstartview = FitH,
bookmarksopen = true,
bookmarksnumbered = true,
linkcolor = black,
plainpages = false,
hypertexnames = false,
citecolor = black] {hyperref}
\usepackage{tikz,pgf,pgfplots}
\usepackage{mathrsfs}
\usetikzlibrary{shapes.geometric,patterns,calc,matrix,arrows.meta}
\setlength{\parindent}{0pt}
\usepackage{amsthm}
\usepackage{wrapfig}
\setlength\parindent{0pt}
\definecolor{myblue}{RGB}{0,56,101}
\definecolor{mygreen}{RGB}{106,176,35}
\definecolor{tablegreen}{RGB}{224,239,212}
\definecolor{tableyellow}{RGB}{255,251,204}
\definecolor{tablered}{RGB}{252,212,209}
\usepackage{colortbl,dcolumn}
\def\zz#1{%
\ifdim#1pt<0.5pt\cellcolor{tablered}\else
\ifdim#1pt<1pt\cellcolor{tableyellow}\else
\cellcolor{tablegreen}\fi\fi
#1}
\makeatother
\usepackage{babel}
\begin{document}
\begin{table}[H]
\begin{center}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|}
\hline
& EK1 & EK2-1 & EK2-2 & EK2-3 & EK3-1 & EK3-2 & EK4 & EK5-1\tabularnewline
\hline
\hline
A & \zz{1} & \zz{1} & \zz{0.5} & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & \zz{1}\tabularnewline
\hline
B & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & \zz{1} & \zz{1}\tabularnewline
\hline
C & \zz{0} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1}\tabularnewline
\hline
D & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & \zz{1} & \zz{1}\tabularnewline
\hline
E & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & \zz{1} & \zz{1}\tabularnewline
\hline
F & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1}\tabularnewline
\hline
G & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1}\tabularnewline
\hline
H & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{0} & \zz{1} & \zz{1}\tabularnewline
\hline
I & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1} & \zz{1}\tabularnewline
\hline
mean values & 0.89 & 1 & 0.94 & 1 & 1 & 0.72 & 0.94 & 1\tabularnewline
\hline
\end{tabular}
\end{center}
\vspace{0.5cm}
\begin{center}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
& EK5-2 & EK5-3 & EK6-1 & EK6-2 & mean values\tabularnewline
\hline
\hline
A & \zz{1} & \zz{0} & \zz{1} & \zz{0} & 0.75\tabularnewline
\hline
B & \cellcolor{tablered} & \zz{0.5} & \zz{1} & \zz{0} & 0.82\tabularnewline
\hline
C & \zz{1} & \zz{0} & \zz{1} & \zz{0.5} & 0.79\tabularnewline
\hline
D & \zz{1} & \zz{1} & \zz{1} & \zz{1} & 0.96\tabularnewline
\hline
E & \zz{0.5} & \zz{1} & \zz{0.5} & \zz{0.5} & 0.83\tabularnewline
\hline
F & \zz{1} & \zz{0.5} & \zz{1} & \zz{0.5} & 0.92\tabularnewline
\hline
G & \zz{1} & \zz{1} & \zz{1} & \zz{0.5} & 0.96\tabularnewline
\hline
H & \zz{1} & \zz{1} & \zz{1} & \zz{1} & 0.92\tabularnewline
\hline
I & \zz{1} & \zz{1} & \zz{1} & \zz{1} & 1\tabularnewline
\hline
mean values & 0.94 & 0.67 & 0.94 & 0.56 & \tabularnewline
\hline
\end{tabular}
\end{center}
\centering{}\caption{example table}
\end{table}
\end{document}
我还删除了raggedright
。现在您的两个表都居中了。