[texhax] TeX Tables Questions

William Adams will.adams at frycomm.com
Tue Nov 16 14:22:31 CET 2010


On Nov 15, 2010, at 2:47 PM, Uwe Lueck wrote:

> ... I once did that too, did not want to explain it -- 

Another, arguably better option would be smashing a parbox or similar multi-line construct.

> *multirow* should provide a smooth alternative:
> 
>    http://ctan.org/pkg/multirow
> 
> There seem to be so many packages for "easy" table formatting, 
> but here the description of the package indicates that it is the 
> best one for the named purpose. (Sorry, never tried myself.)

A perfect solution which works nicely w/ booktabs (aside from the nuisance of measuring the width of the text column):

\documentclass{article}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{xcolor}
\begin{document}
\begin{center}
\begin{tabular}{lccccccccccccccc}
\toprule
&\multirow{2}{51bp}{Dynamic Instruction}&\multicolumn{14}{c}{Cycle}\\
\cmidrule(r){3-16}
& &{\small 0}&{\small 1}&{\small 2}&{\small 3}&{\small 4}&{\small 5}&{\small 6}&{\small 7}&{\small 8}&{\small 9}&{\small 10}&{\small 11}&{\small 12}&{\small 13}\\
\midrule
{\small 1}&&F &D &I&$Y_{0}$&$Y_{1}$&$Y_{2}$&${\color{red}Y_{3}}$&W\\
{\small 2}&& &F &D&i&i&i&I&${\color{red}Y_{0}}$&$Y_{1}$&$Y_{2}$&$Y_{3}$&W\\
{\small 3}&& & &F&D&I&X&w&w&w&w&w&w&W\\
{\small 4}&& \\
{\small 5}&& \\
\bottomrule
\end{tabular}
\end{center}
\end{document}

-- 
William Adams
senior graphic designer
Fry Communications
Sphinx of black quartz, judge my vow.




More information about the texhax mailing list