\documentclass{article}
\begin{document}
\begin{tabular*}{\textwidth}{@{}l@{\extracolsep{\fill}}r@{}}%
\hline a&b\\\hline
\end{tabular*}
\end{document}
Of course, if the table is not in a float (a table
environment) and \partindent
is not 0pt (the default) as in this MWE, remember add \noindent
before the tabular*
environment to maintain it between the page margins.
If you refer to extend the table to the page margins, as L. Nielsen suspected, the trick is put the table in a centered box of zero space, and of course, make the table enough big:
\documentclass{article}
\usepackage{geometry}
\begin{document}
\centering\makebox[0cm]{%
\begin{tabular*}{\paperwidth}{@{}l@{\extracolsep{\fill}}r@{}}%
\hline a&b\\\hline%
\end{tabular*}}%
\end{document}
@{}l@{\extracolsep{\fill}}r@{}