The macros \halign
and \valign
are documented in the TeXbook. More accurately \halign
is described in detail there, and \valign
is introduced briefly, saying that is analogous.
The \valign
statement starts with a preamble than has the form
pre-row-1 # post-row-1& pre-row-2 # post-row-2& .... & ... # post-row-n\cr
the table material is for the given column is inserted in place of the #
's much as in macros. A short cut is that an extra &
at the beginning or immediately after another &
, means that the format material from that point up to the \cr
is repeated for all subsequent rows. Thus a preamble
&pre-row # post-row\cr
produces an arbitrary number of rows with the same format.
In the table you add entries in the usual way; rows separated by &
, column ending with \cr
. A complete column format specification can be replaced by other material via \noalign{...}
; so \noalign{\vrule}
produces a vertical rule the whole way down the table. A single row is replaced by writing \omit<...>
where <...>
is the new material. The analogue of \multicolumn
is \multispan
, thus \multispan3<...>
will spread <...>
over three rows.
Here is your example:

\documentclass{article}
\begin{document}
\valign{% Preamble
&\hrule\vskip 2pt plus 1fil\hbox{\strut\quad #\quad}\vfil\cr
% First rule empty row one, span across rows 2 and 3, empty in row 4
\omit&\multispan2\leaders\vrule\vfil&\omit\cr
% First column, first cell has non-standard format without rule
\omit \vskip 2.4pt plus 1fil\hbox{\strut\quad a\quad}\vfil&d&g&j\cr
% Second vertical rule, span rows 1 to 3, empty row 4
\multispan3\leaders\vrule\vfil&\omit\cr
% Second column, all cells are regular
b&e&h&k\cr
\multispan3\leaders\vrule\vfil&\omit\cr
c&f&i&l\cr
\multispan3\leaders\vrule\vfil&\omit\cr}
\end{document}
The preamble says each row starts with a horizontal rule, a vertical space of 2pt
that can stretch followed by a horizontal box containing the material (padded with \quad
space on each size and with a guaranteed minimum height and depth from \strut
) followed by stretchable vertical space.
\leaders\vrule\vfil
is what \vrulefill
ought to be, but the command happens not to be defined, this is used in combination with \multispan
to draw the vertical rules over the appropriate rows.
When we use \omit
for the box containing a
we have to provided the relevant parts of the formatting that we still need. The extra .4pt
on the \vskip
accounts for the thickness of the \hrule
.
An alternative approach to the whole table would be to provide separate rows for the rules, but then this essentially doubles the number of &
s we have to write.