0

I am new to latex. I have tried to make the following table center. I have tried \centering and \begin{center} both approach. However, it is not moving a bit. How to make this table center. Thank you.

\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}

The following part is the head part. In case you need.

\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

like this?

enter image description here

(red lines indicate text borders)

for above result i remove minipage environment and add \centering after \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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.