![如何让表格居中?](https://linux22.com/image/479149/%E5%A6%82%E4%BD%95%E8%AE%A9%E8%A1%A8%E6%A0%BC%E5%B1%85%E4%B8%AD%EF%BC%9F.png)
\section{Technical Skills}
\vspace{1mm}
% Please add the following required packages to your document preamble:
% \usepackage{booktabs}
\begin{table}
\centering
\begin{tabular}{@{}ll@{}}
\toprule
\textbf{\begin{tabular}[c]{@{}l@{}}Programming \\ Languages\end{tabular}} & \begin{tabular}[c]{@{}l@{}} $\bullet${\textbf{ Technical:}} C, MATLAB, Python\\ $\bullet${\textbf{ Editing:}} Photoshop\end{tabular} \\ \midrule
\textbf{\begin{tabular}[c]{@{}l@{}}Software\\ Packages\end{tabular}} & \begin{tabular}[c]{@{}l@{}} $\bullet${\textbf{ AutoCad:}} Design and Drafting\\ $\bullet${\textbf{ Ansys:}} Finite Element Software\\ $\bullet${\textbf{ ArcGis:}} Analyse Spatial Data\\ $\bullet${\textbf{ Qualk2k:}} Surface Water Quality Modeling\\ $\bullet${\textbf{ SWMM:}} Strom Water Management \& Modeling\end{tabular} \\ \bottomrule
\end{tabular}
\end{table}[![][1]][1]
答案1
特别是,我在环境方面遇到了很多问题table
。如果您不需要“Table X”,则无需使用\begin{table}
。如果您需要这个,您可以使用以下包之一:caption
,capt-of
或班级memoir
。
table
没有and 使用caption
and 的示例minipage
:
\documentclass{article}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{changepage}
\begin{document}
\section{Technical Skills}
\vspace{1mm}
Some text
\begin{tabular}{@{}ll@{}}
\toprule
\textbf{\begin{tabular}[c]{@{}l@{}}Programming \\ Languages\end{tabular}} & \begin{tabular}[c]{@{}l@{}} $\bullet${\textbf{ Technical:}} C, MATLAB, Python\\ $\bullet${\textbf{ Editing:}} Photoshop\end{tabular} \\ \midrule
\textbf{\begin{tabular}[c]{@{}l@{}}Software\\ Packages\end{tabular}} & \begin{tabular}[c]{@{}l@{}} $\bullet${\textbf{ AutoCad:}} Design and Drafting\\ $\bullet${\textbf{ Ansys:}} Finite Element Software\\ $\bullet${\textbf{ ArcGis:}} Analyse Spatial Data\\ $\bullet${\textbf{ Qualk2k:}} Surface Water Quality Modeling\\ $\bullet${\textbf{ SWMM:}} Strom Water Management \& Modeling\end{tabular} \\ \bottomrule
\end{tabular}
\vspace{15mm}
\begin{adjustwidth}{-2cm}{}
\begin{tabular}{@{}ll@{}}
\toprule
\textbf{\begin{tabular}[c]{@{}l@{}}Programming \\ Languages\end{tabular}} & \begin{tabular}[c]{@{}l@{}} $\bullet${\textbf{ Technical:}} C, MATLAB, Python\\ $\bullet${\textbf{ Editing:}} Photoshop\end{tabular} \\ \midrule
\textbf{\begin{tabular}[c]{@{}l@{}}Software\\ Packages\end{tabular}} & \begin{tabular}[c]{@{}l@{}} $\bullet${\textbf{ AutoCad:}} Design and Drafting\\ $\bullet${\textbf{ Ansys:}} Finite Element Software\\ $\bullet${\textbf{ ArcGis:}} Analyse Spatial Data\\ $\bullet${\textbf{ Qualk2k:}} Surface Water Quality Modeling\\ $\bullet${\textbf{ SWMM:}} Strom Water Management \& Modeling\end{tabular} \\ \bottomrule
\end{tabular}
\end{adjustwidth}
\vspace{15mm}
\begin{minipage}{\textwidth}
\captionof{table}{Name of table}
\begin{tabular}{@{}ll@{}}
\toprule
\textbf{\begin{tabular}[c]{@{}l@{}}Programming \\ Languages\end{tabular}} & \begin{tabular}[c]{@{}l@{}} $\bullet${\textbf{ Technical:}} C, MATLAB, Python\\ $\bullet${\textbf{ Editing:}} Photoshop\end{tabular} \\ \midrule
\textbf{\begin{tabular}[c]{@{}l@{}}Software\\ Packages\end{tabular}} & \begin{tabular}[c]{@{}l@{}} $\bullet${\textbf{ AutoCad:}} Design and Drafting\\ $\bullet${\textbf{ Ansys:}} Finite Element Software\\ $\bullet${\textbf{ ArcGis:}} Analyse Spatial Data\\ $\bullet${\textbf{ Qualk2k:}} Surface Water Quality Modeling\\ $\bullet${\textbf{ SWMM:}} Strom Water Management \& Modeling\end{tabular} \\ \bottomrule
\end{tabular}
\end{minipage}
\end{document}
答案2
如果您添加文档类并加载包 boooktabs,表格将编译成功并位于中心。如果您更喜欢标题后的表格,请尝试将选项添加\begin{table}[h!]
到表格环境中(它可能有效,但并非总是有效):
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\section{Technical Skills}
\vspace{1mm}
Some text
\begin{table} %% Add option [h!] if you prefer the table after the heading.
\centering
\begin{tabular}{@{}ll@{}}
\toprule
\textbf{\begin{tabular}[c]{@{}l@{}}Programming \\ Languages\end{tabular}} & \begin{tabular}[c]{@{}l@{}} $\bullet${\textbf{ Technical:}} C, MATLAB, Python\\ $\bullet${\textbf{ Editing:}} Photoshop\end{tabular} \\ \midrule
\textbf{\begin{tabular}[c]{@{}l@{}}Software\\ Packages\end{tabular}} & \begin{tabular}[c]{@{}l@{}} $\bullet${\textbf{ AutoCad:}} Design and Drafting\\ $\bullet${\textbf{ Ansys:}} Finite Element Software\\ $\bullet${\textbf{ ArcGis:}} Analyse Spatial Data\\ $\bullet${\textbf{ Qualk2k:}} Surface Water Quality Modeling\\ $\bullet${\textbf{ SWMM:}} Strom Water Management \& Modeling\end{tabular} \\ \bottomrule
\end{tabular}
\end{table}
\end{document}
带选项[h!]
: