# Centering a simple table of text

Seems a stupid problem, but I can't find solutions on previously answered questions here on tex.stackexchange. I have the following table (pretty simple):

\begin{table}[h]
\centering
\begin{center}
\begin{tabular}{ | p{2.5cm} | p{2.5cm} | p{1.5cm} | p{2cm} | p{1.2cm} | p{3cm} | p{1cm} |}

\hline
Id\_String &    Date &  E\_prod & MaxPm & FragPm & Tmax & Tprod \\ \hline
blah &
blah &
blah &
blah &
blah &
blah &
blah \\
\hline
\end{tabular}
\caption{Blah blah blah.}
\label{table:blah}
\end{center}
\end{table}


Which results in the following:

So as you can see the table is not in the center of the sheet (which is as wide as the screenshot), but it "overflows" on the right. I'd like it to start a little bit on the left in order to be perfectly centered in the pdf.

tex.stackexchange, what to do?

EDIT: The solution proposed in here does not solve the issue. The result I obtain by applying such solution is exactly the same as shown here.

• a simple solution is provided in the link, which you provide (see third answer). – Zarko Sep 24 '15 at 12:03

This is certainly a duplicate, but since you say you couldn't make it work, here is a way.

Put the table inside a box:

\documentclass{article}
\usepackage{showframe}  %% just for demo
\begin{document}
\begin{table}[h]
\centering
\makebox[\textwidth]{%
\begin{tabular}{ | p{2.5cm} | p{2.5cm} | p{1.5cm} | p{2cm} | p{1.2cm} | p{3cm} | p{1cm} |}
\hline
Id\_String &    Date &  E\_prod & MaxPm & FragPm & Tmax & Tprod \\ \hline
blah &
blah &
blah &
blah &
blah &
blah &
blah \\
\hline
\end{tabular}
}
\caption{Blah blah blah.}
\label{table:blah}
\end{table}
\end{document}


You can also use adjustbox package:

\documentclass{article}
\usepackage{showframe}
\begin{document}
\begin{table}[h]
\begin{tabular}{ | p{2.5cm} | p{2.5cm} | p{1.5cm} | p{2cm} | p{1.2cm} | p{3cm} | p{1cm} |}
\hline
Id\_String &    Date &  E\_prod & MaxPm & FragPm & Tmax & Tprod \\ \hline
blah &
blah &
blah &
blah &
blah &
blah &
blah \\
\hline
\end{tabular}