[texhax] "vertical" text within tabular cell

Bryan W. Lepore Bryan.Lepore at umassmed.edu
Tue Jul 28 18:37:39 CEST 2009


i want a table to have the text of one of the columns with "vertical", or 
"rotated-by-90-degrees" text so that it is read from bottom to top of the 
table, e.g. along the table edge.  it is impossible to provide an 
appropriate plain-text email example, so please see the attached source 
code.

some webpages describe this:

[1] http://tinyurl.com/lc5ru6 (uses "sideways")
[2] http://tinyurl.com/nav4s5 (uses "multirow" plus "sideways")

in my hands, method [1] puts a space that is the width of the text in the 
table, "spreading" the table out in the important table content, but is 
closest to what i want.  method [2] puts carriage returns after each word 
and again "spreads" the table out, but only in column 1.  i clearly do not 
understand how each works.

so i am asking for any suggestions or insight, especially to eliminate the 
"spreading" from the "sideways" method.

-bryan
-------------- next part --------------
\documentclass[12pt]{article}
\usepackage{multirow}
\usepackage{rotating}
\begin{document}
\begin{tabular}{|l|l|l|l|l|l|}\hline
%-------------------------------------------------------------------------------------
\multicolumn{2}{|c}{}                                 & \multicolumn{4}{|c|}{codon position no. 2          } \\ \cline{3-6}
\multicolumn{2}{|c|}{}                                & {\bf U} & {\bf C} & {\bf A}   & {\bf G}              \\ \cline{2-6}
%-------------------------------------------------------------------------------------
                                             &        & UUU:Phe & UCU:Ser & UAU:Tyr   & UGU:Cys  \\ 
                                             &        & UUC:Phe & UCC:Ser & UAC:Tyr   & UGC:Cys  \\ 
                                             &{\bf U} & UUA:Leu & UCA:Ser & UAA:Ochre & UGA:Opal \\ 
                                             &        & UUG:Leu & UCG:Ser & UAG:Amber & UGG:Trp  \\ \cline{2-6}
%-------------------------------------------------------------------------------------
                                             &        & CUU:Leu & CCU:Pro & CAU:His   & CGU:Arg \\ 
                                             &        & CUC:Leu & CCC:Pro & CAC:His   & CGC:Arg \\ 
                                             &{\bf C} & CUA:Leu & CCA:Pro & CAA:Gln   & CGA:Arg \\ 
                                             &        & CUG:Leu & CCG:Pro & CAG:Gln   & CGG:Arg \\ \cline{2-6}
%-------------------------------------------------------------------------------------
                                             &        & AUU:Ile & ACU:Thr & AAU:Asn   & AGU:Ser \\ 
                                             &        & AUC:Ile & ACC:Thr & AAC:Asn   & AGC:Ser \\ 
%\begin{sideways}{codon position \#2 }\end{sideways}
\multirow{4}{1mm}{\begin{sideways}\parbox{15mm}{codon position \#2 }\end{sideways}}
                                             &{\bf A} & AUA:Ile & ACA:Thr & AAA:Lys   & AGA:Arg \\ 
                                             &        & AUG:Met & ACG:Thr & AAG:Lys   & AGG:Arg \\ \cline{2-6}
%-------------------------------------------------------------------------------------
                                             &        & GUU:Val & GCU:Ala & GAU:Asp   & GGU:Gly\\ 
                                             &        & GUC:Val & GCC:Ala & GAC:Asp   & GGC:Gly\\ 
                                             &{\bf G} & GUA:Val & GCA:Ala & GAA:Glu   & GGA:Gly\\ 
                                             &        & GUG:Val & GCG:Ala & GAG:Glu   & GGG:Gly\\ \hline
%-------------------------------------------------------------------------------------
\end{tabular}
\end{document}


More information about the texhax mailing list