Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Center table and make one row different

I’ve got a table like:

\begin{center} 
\begin{table} [h]
\caption{some caption.} 
    \label{tab: 1}
\begin{tabular}{||c | c c c c c||}
 \hline
Team &Goal& SOG& SA& Hits& Possession\\ 
 \hline\hline
 \textbf{Team1} & 54 & 171 &    464 & 941 & 11:46:33
 \\ 
 \hline
 \textbf{Team2} & 89 & 237 & 502 & 861 & 10:28:02 \\ 
\hline \hline
Per cent split\\
 \hline \hline
 \textbf{Team1}&  38\% &    42\% &  48\% &  52\% &  53\%  \\
  \hline
  \end{tabular}
  \end{table}
\end{center}

And I cannot seem to center it. I’ve wrapped it in a \center but it still pushes to the left of the page. I am also wondering how to alter the row with Per cent split: ideally I’d want the text centered on the row and the row to end in the same manner that the table does, right now it does not do that.

Thanks

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You center instructions must be within the table environment. However you shouldn’t use the center environment. This will add additional vertical spacing. You should use \centering instead.

\documentclass{article}

\begin{document}

%\begin{center} 
\begin{table} [h]
\caption{some caption.} 
    \label{tab: 1}
    \centering
\begin{tabular}{||c | c c c c c||}
 \hline
Team &Goal& SOG& SA& Hits& Possession\\ 
 \hline\hline
 \textbf{Team1} & 54 & 171 &    464 & 941 & 11:46:33
 \\ 
 \hline
 \textbf{Team2} & 89 & 237 & 502 & 861 & 10:28:02 \\ 
\hline \hline
\multicolumn{6}{||c||}{Per cent split}\\
 \hline \hline
 \textbf{Team1}&  38\% &    42\% &  48\% &  52\% &  53\%  \\
  \hline
  \end{tabular}
  \end{table}
%\end{center}


\end{document}

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading