1

Is there a way to achieve a table of width \textwidth, with the top row being of normal height, and the remaining rows filling the rest of the page in equal proportion?

I have this implemented but with an inexact fudge factor. I can imagine some implementation using a fancy tabular package (I was not able to make tabularht work) or something like the below where \rowht is set precisely based on \arraystretch or something and the height of the header, but I don't know how to do that.

\documentclass{article}
\usepackage{tabularx}
\usepackage[margin=1in]{geometry}
\def\rowht{0.935in}
\pagestyle{empty}
\begin{document}
\noindent
\begin{tabularx}{\textwidth}{| X | X | X | X |}
  \hline
  A & B & C & D \\\hline
  & & &\\[\rowht]\hline
  & & &\\[\rowht]\hline
  & & &\\[\rowht]\hline
  & & &\\[\rowht]\hline
  & & &\\[\rowht]\hline
  & & &\\[\rowht]\hline
  & & &\\[\rowht]\hline
  & & &\\[\rowht]\hline
\end{tabularx}
\end{document}

enter image description here

1 Answer 1

1

I will give a solution with the new LaTeX3 package tabularray:

\documentclass{article}
\usepackage[margin=1in]{geometry}
%\usepackage{showframe}
%\renewcommand*{\ShowFrameColor}{\color{red}}
\pagestyle{empty}
\usepackage{tabularray}
\def\rowht{%
  \dimexpr
    (
      \textheight
       - \baselineskip                   % height of first row
       - 4pt * \value{rowcount}          % rowsep sizes
       - 0.4pt * ( \value{rowcount} - 1) % hrule sizes
    ) / ( \value{rowcount} - 1 )
  \relax
}
\begin{document}

\noindent
\begin{tblr}{
  colspec={|X|X|X|X|},
  hlines,
  row{2-Z} = {\rowht}, % Z stands for the last row
}
  A & B & C & D \\
    &   &   &   \\
    &   &   &   \\
    &   &   &   \\
    &   &   &   \\
    &   &   &   \\
    &   &   &   \\
    &   &   &   \\
    &   &   &   \\
\end{tblr}

\newpage

\noindent
\begin{tblr}{
  colspec={|X|X|X|X|},
  hlines,
  row{2-Z} = {\rowht},
}
  A & B & C & D \\
    &   &   &   \\
    &   &   &   \\
    &   &   &   \\
    &   &   &   \\
    &   &   &   \\
\end{tblr}

\end{document}

enter image description here

2
  • So new I did not have it in my distribution. Looks exciting. Thanks
    – tsj
    Aug 14, 2021 at 3:07
  • You can update your TeXlive or MikTeX to get it.
    – L.J.R.
    Aug 14, 2021 at 3:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .