5

I am trying to create a very simple, one row table that spans the linewidth. When I use the following command:

\begin{tabular*}{\linewidth}{l@{\extracolsep{\fill}}r}
Entry 1 & Entry 2
\end{tabular*}

the first entry is slightly indented and the second entry entends past the linewidth. How do I make it so that the first entry is aligned with the left margin and the second entry is aligned with the right margin?

lockstep
  • 250,273
richtera
  • 1,521

1 Answers1

6

Add \noindent before \begin{tabular*} if you use the tabular* environment outside a table float.

EDIT: As Werner points out, you may also remove the \tabcolsep before the first and after the last column (using @{}).

\documentclass{article}

\usepackage{lipsum}

\begin{document}

\lipsum[1]

\bigskip

\noindent
\begin{tabular*}{\linewidth}{@{}l@{\extracolsep{\fill}}r@{}}
Entry 1 & Entry 2
\end{tabular*}

\end{document}

enter image description here

lockstep
  • 250,273