我是乳胶新手。我尝试过制作以下表格中心。我尝试过\定心和\开始{中心}两种方法都可以。但是,它一点儿也不动。如何让这个表格居中。谢谢。
\begin{table}
\caption{Abstract configuration of the device used in scraping}
\begin{minipage}{\textwidth}
\begin{tabular}{lcl}
\hline\hline
Name & : & Inspur NF5170M4 1U Server \\
Processor & : & Intel®Xeon®E5-2600V3 or V4\\ Processors
Chipset & : & Intel ®C610 server chipset\\
Memory & : & 32GB \\
\hline\hline
\end{tabular}
\vspace{-2\baselineskip}
\end{minipage}
\label{table1}
\end{table}
以下部分是头部。以防你需要。
\documentclass{nle}
\makeatletter
\let\O@argtabularcr\@argtabularcr
\def\O@xtabularcr{\@ifnextchar[\O@argtabularcr{\ifnum 0=`{\fi}\cr}}
\let\O@tabacol\@tabacol
\let\O@tabclassiv\@tabclassiv
\let\O@tabclassz\@tabclassz
\let\O@tabarray\@tabarray
\def\author@tabular{\authorsize\def\@halignto{}\@authortable}
\let\endauthor@tabular=\endtabular
\def\author@tabcrone{{\ifnum0=`}\fi\O@xtabularcr\affilsize\itshape
\let\\=\author@tabcrtwo\ignorespaces}
\def\author@tabcrtwo{{\ifnum0=`}\fi\O@xtabularcr[-3\p@]\affilsize\itshape
\let\\=\author@tabcrtwo\ignorespaces}
\def\@authortable{\leavevmode \hbox \bgroup $\let\@acol\O@tabacol
\let\@classz\O@tabclassz \let\@classiv\O@tabclassiv
\let\\=\author@tabcrone \ignorespaces \O@tabarray}
\makeatother
\usepackage{xcolor}
\usepackage{listings}
\usepackage{booktabs}
\usepackage{array}
答案1
像这样?
(红线表示文本边框)
对于上述结果,我删除了minipage
环境并\centering
添加\begin{table}
:
\documentclass[a4paper, 12pt]{article}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}
\begin{table}
\centering
\caption{Abstract configuration of the device used in scraping}
\label{table1}
\begin{tabular}{lcl}
\hline\hline
Name & : & Inspur NF5170M4 1U Server \\
Processor & : & Intel®Xeon®E5-2600V3 or V4\\ Processors
Chipset & : & Intel ®C610 server chipset\\
Memory & : & 32GB \\
\hline\hline
\end{tabular}
\end{table}
\end{document}