# \hfill underlining in a tabular environment

I would like to make a name and address fill-in-the-blank in a neat rectangle with a lined space where the information should be filled in. At first I came up with this:

\begin{tabular}{ll}
\multicolumn{2}{l}{NAME\underline{\hspace{15em}}\\
\multicolumn{2}{l}{CITY\underline{\hspace{15em}}} \\
STATE\underline{\hspace{3em}} & ZIP\underline{\hspace{8em}}
\end{tabular}


But this yields a ragged right edge and tinkering with the \hspace{} parameters is a non-starter. I tried this:

\begin{tabular}{ll}
\multicolumn{2}{l}{NAME\underline{\hspace{15em}}\\
\multicolumn{2}{l}{CITY\underline{\hfill}} \\
STATE\underline{\hspace{3em}} & ZIP\underline{\hfill}
\end{tabular}


But I get no underlines at all with the \hfills. I don't want to simply make this a tabular with \hlines because that will result in underlined field names or gaps between the field names and the underlining.

-

## migrated from stackoverflow.comJul 22 '13 at 13:02

This question came from our site for professional and enthusiast programmers.

It is far easier to leave the guess-work to TeX. In the example below I've fixed the tabular to a single paragraph column of width 20em. Rules are inserted using leaders (via \hrulefill):

\documentclass{article}
\begin{document}
\noindent
\begin{tabular}{@{}p{20em}@{}}
NAME~\hrulefill \\

The rule associated with ZIP is twice that of STATE, as suggested by the double \hrulefill. The total width of the table is 20em, since padding on either end has been removed with @{}.