Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I found the \resizebox command but I don't want to scale my table. I want to be able to set it to X height and have it stay there. Is there a way to set the height of a table and leave it there no matter how many rows?

I ask since the table in the middle of my document will always vary and sometimes have one row and sometimes have 4 rows. When I set it up to one row with measurements and then add more rows it moves my items below it.

I want that when I add more rows to the table in the middle it doesn't move the content below it. So I was figuring that setting the height to begin with will solve that, I just can't find how to set that height parameter.

This is my table:

\begin{tabular}{ @{} p{0.5in} p{3.25in} p{0.5in} @{} }
\textbf{date} & \textbf{date} & \textbf{date} \\
\end{tabular}
share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

You can put your table in a minipage with a fixed height:

\noindent\begin{minipage}[t][4in][t]{\textwidth}
\centering
\begin{tabular}{ @{} p{0.5in} p{3.25in} p{0.5in} @{} }
\textbf{date} & \textbf{date} & \textbf{date} \\
\end{tabular}
\end{minipage}

The first optional argument tells what's the alignment of the minipage with respect to the context (it may well be also c). The second optional argument tells how much vertical size is reserved to the minipage (just figure out what you need). The third optional argument is the "inner alignment": it can be t for "top alignment", c for "center alignment", b for "bottom alignment and also s for "stretch all vertical spaces"; here the alignment is with respect to the top and the bottom of the reserved space. The s option doesn't make sense in this case.

share|improve this answer
add comment

I suggest that you Use Heiko Oberdiek’s tabularht-package from his oberdiek-bundle. The package gives you the possibility to specify the height of the tabular.

Two MWEs:

% Table 1
\documentclass{standalone}
\usepackage{array,tabularht}
\begin{document}
\begin{tabularht}{50mm}{|l|l|}
Hello & World\\
Foo & Bar\\
Bar&foo\\\noalign{\vfill}
\end{tabularht}
\end{document}

% Table 2
\documentclass{standalone}
\usepackage{array,tabularht}
\begin{document}
\begin{tabularht}{50mm}{|l|l|}
Hello & World\\
\interrowfill
Foo & Bar\\
Bar&foo\\
\end{tabularht}
\end{document}

Tabel 1 enter image description here Table 2 enter image description here

Both tables have the same high, but table 2 fills the excess white space between two rows, table 1 places the white space after the last row.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.