# Flushing something towards the bottom of a tabular cell, without affecting the calculations for the height of the tabular

I'm trying to produce lines at the top and at the bottom of two cells of my tabular. The two cells both have some text in them, from which I want to take the larger cell to determine the width of both cells, hence the tabular solution.

The next step was to produce lines, for instance through the use of \hrule. For the larger cell the output is as intended: a line at the very top and at the very bottom of the tabular cell. For the smaller cell I intended to use \hfil or \hfill to flush the second \hrule towards the bottom, but \hfil seems to be discarded. What can I do to produce a line at the bottom of the first table cell, so that both lines align horizontally?

\documentclass{extarticle}

%\usepackage{multicol}
\usepackage{lipsum}
\usepackage[a4paper]{geometry}
\usepackage{xcolor}

\begin{document}

\begin{tabular}{p{\dimexpr.5\linewidth-2\tabcolsep}p{\dimexpr.5\linewidth-2\tabcolsep}}
\textcolor{gray}{\hrule height .5pt depth .5pt}
\bigskip
\textsc{K E Y W O R D S}
\hfil %\hfill
\textcolor{gray}{\hrule height .5pt depth .5pt}
&  \textcolor{gray}{\hrule height .5pt depth .5pt}
\bigskip \textsc{A B S T R A C T}
\lipsum[2]
\textcolor{gray}{\hrule height .5pt depth .5pt}\\
\end{tabular}

%\begin{multicols}{3}
%
%\end{multicols}
\end{document}

• Tabular only computes the widths, not the heights. Besides, for filling vertical space you need \vfil – egreg Sep 20 '14 at 9:50

You can't create cells with equal height automatically with tabular. This is a case where \valign comes handy.

\documentclass{article}

\usepackage{lipsum}
\usepackage[a4paper,showframe]{geometry}
\usepackage{xcolor}
\usepackage{microtype}

\newcommand{\keyabs}[2]{%
\noindent
\valign{%
\hrule height 1pt
\vskip .5ex
\hsize=\dimexpr.5\linewidth-2\tabcolsep
##\vfil
\vskip .5ex
\hrule height 1pt
\cr
\noindent\textls{KEYWORDS} #1\cr
\noalign{\hfill}
\noindent\textls{ABSTRACT} #2\cr
}\par
}

\begin{document}

\keyabs{something}{\lipsum[2]}

\end{document}


\valign is the “transpose” of \halign on which tabular is built upon. The showframe option is just to show the page margins (the thin rules).

If you want lightgray rules, change the code into

\newcommand{\keyabs}[2]{%
\noindent
\valign{%
\hsize=\dimexpr.5\linewidth-2\tabcolsep
\vskip 0.5ex
##\vfil\nointerlineskip
\vskip 0.5ex

• Accepted the answer. One question remains though: could you explain how #\vfil works? How can a token follow a hash #...?! – 1010011010 Sep 20 '14 at 10:21
• @1010011010 It's the syntax of \halign and \valign; ## stands here for the cell body (it's doubled because we're in a definition). I added a variant for colored rules. – egreg Sep 20 '14 at 10:24