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 want to create a LaTeX table with three rows which have different row heights. How can I do this?

The following code

\renewcommand\arraystretch{2.4} \setlength\minrowclearance{2.4pt}

seems make each row has the same height.

share|improve this question
5  
you could probably use \rule{0pt}{<lenght>} to create a line with 0 width but a certain vertical length. –  Martin H Jun 1 '11 at 7:32

2 Answers 2

a table with horizontally and vertically centered elements with package easytable:

\documentclass{article}
\usepackage[thinlines]{easytable}
\begin{document}

\begin{TAB}(e,10ex,5ex){|c|c|}{|c|c|c|}
hi & tall one\\
hi & medium one\\
hi & standard one\\
\end{TAB}

\end{document}

enter image description here

share|improve this answer
13  
am I going insane or are all those exactly the same height? –  puk Apr 18 at 1:02

Try this:

\documentclass{article}
\begin{document}
\begin{tabular}{cc}
\hline
hi & tall one\\[10ex]
\hline
hi & medium one\\[5ex]
\hline
hi & standard one\\
\hline
\end{tabular}
\end{document}

So you can specify the height of a row with the optional argument

share|improve this answer
7  
how do you vertically centralize the elements in a cell, using the [ex] optional argument?! –  Ivan Machado Nov 21 '12 at 22:57
4  
Using \\[<space>] adds space to the end of the last cell, so if the last cell of each row has significantly different contents, then the row height can vary. This is easily solved by adding an extra column, and keeping it empty. Then \\[<space>] always makes the row <space> as a minimum. –  Nathanael Farley Dec 17 '12 at 11:03
    
@NathanaelFarley This won't help when you have hlines as then adding an additional column will produce extra lines at the end. Additionally, it still keeps the contents vertically spaced near the top rather than within the cell in the center vertically –  Aram Papazian Aug 15 at 13:07
    
@AramPapazian This can be fixed by using columns like {cc@{}c@{}} as the @{} will make the space either side of the empty column 0 pt. –  Nathanael Farley Aug 18 at 9:12

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.