row height in tables 

Newsgroups: comp.text.tex
Date: Thu, 20 Oct 2005

I like to construct a table with different heights of rows. For example, the first row (colored) has an one line text with footnote size characters (with some identifying items for the next row), the second row also has an one line text, but with normal size of characters. I like that high of rows will be adjusted to height of characters. Is thehe any possibility to acieve this?

I look in FAQ and found the solution, how ones can change the whole row in table (using array package), but unfortunately, this work only for change the size (or style) of characters but the height of row remain the same as the other rows with normal size characters.

Look around by Google gives modest results, from that this is not wise to do to that this is almost impossible in LaTeX.

Regards, Zarko

row height in tables 

tabular use for the rows the height of the strutbox of the fontsize that is active at the start of the tabular.

So you could try the following: set a small fontsize e.g. \tiny before the tabular. And in the cells use e.g. \small\strut …. or \normalsize\strut. (You need the \strut only in one cell in a row and it can come at the end). If you use a p-column you should put a \strut at the start and at the end of the text.

Ulrike Fischer

row height in tables 

> So you could try the following: set a small fontsize e.g. \tiny before
> the tabular.

And the strut is scaled by \arraystretch. Probably the following redefinition already helps:

\renewcommand{\arraystretch}{0}

Heiko <oberd…@uni-freiburg.de>

row height in tables 

After some experiments i found a solution which gives me desired behavior. In preamble I put macro from FAQ UK, omit the suggested start size \tiny.

Not just minimal example (but it show all desired look-out) what I did:

\usepackage{array,tabularx,colortbl}

% for fixed size of cells in tabularx % for colored cells

% from FAQ UK \newcolumntype{$}{>{global\let\currentrowstyle\relax}} \newcolumntype{^}{>{currentrowstyle}} \newcommand\rowstyle[1]{gdef\currentrowstyle{#1}% #1\ignorespaces}

\caption{ISO 646 - ISO 7 bitni kod, osnovni.} \hline \rowstyle{scriptsize\strut}% this adjust the rowh height and % character size \rowstyle{normalsize\strut}% this adjust the rowh height and % character size & DLE

well, a some problems still remain. the first one (quite disturbing) is that the space above text in rows is not the same as bellow, that second one is that the width of cells and the right side of rows don't align anymore.

regards, Zarko

row height in tables 

You need to put the size commands in every cell. It's only the strut that is needed only once per row.

> After some experiments i found a solution which gives me desired
> behavior. .. some problems still remain. the first one (quite disturbing)
> is that the space above text in rows is not the same as bellow,

That is the normal behaviour of the strut/tabular. If you want more space you will have to use another invisible rule with more height (or less depth).

> that
> second one is that the width of cells and the right side of rows don't
> align anymore. Do you or anybody how some idea how to copy with this?

With array it matters if you put in \multicolumn the rule before or after the cell.

\parskip1cm

\fbox{strut N}

\hline N \\\hline

Ulrike Fischer

row height in tables 

> \documentclass[a4paper,12pt]{book}
> ...
> \end{document}

following your example I rearrange the positions of | in my tables and now the all cells align as it is expected!

thank you very much for your valuable help!

regards, Zarko