2

I have cells in a tabular environment that have the text rotate 90 degrees. I am unclear as to how to have the text be 'top' aligned, i.e., right justified given the rotate text. Below is what is currently being produced and the TeX generating it. What I would want to see is all the text in the cells even along the top of the cell, ragged along the bottom.

enter image description here

\newcolumntype{R}{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{0.32in}}

% other irrelevant preamble code

\begin{center}
{\tabcolsep=0pt\def\arraystretch{1.3}
\begin{tabular}{ | R | R | R | R | R | R | R | R | R | R | }
\multicolumn{10}{c}{\HUGE January}\bigskip\\
\hline
\rotatebox{90} {~~~~~~~~Wednesday, January 1~~} & \rotatebox{90} {~~~~~~~~Thursday, January 2~~} & \rotatebox{90} {~~~~~~~~Friday, January 3~~} & \rotatebox{90} {~~~~~~~~Saturday, January 4~~} & \rotatebox{90} {~~~~~~~~Sunday, January 5~~} & \rotatebox{90} {~~~~~~~~Monday, January 6~~} & \rotatebox{90} {~~~~~~~~Tuesday, January 7~~} & \rotatebox{90} {~~~~~~~~Wednesday, January 8~~} & \rotatebox{90} {~~~~~~~~Thursday, January 9~~} & \rotatebox{90} {~~~~~~~~Friday, January 10~~} \\    \hline

\end{tabular}}
\end{center}

2 Answers 2

2

With use of the packages rotating and makecell

\documentclass{article}
\usepackage{rotating}
\usepackage{makecell}
\newcolumntype{C}{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{0.32in}}

\begin{document}
    \begin{center}
\setlength{\tabcolsep}{0pt}% Remove space between tabular columns
\renewcommand{\arraystretch}{1.3}% Stretch rows vertically
\renewcommand\theadfont{\normalsize}
\settowidth\rotheadsize{\theadfont Wednesday, January 22}
\begin{tabular}{ | *{10}{C |} }
\multicolumn{10}{c}{\Huge January} \bigskip\\
    \hline
\rothead{\hfill Wednesday, January 1}  &
\rothead{\hfill Thursday, January 2}   &
\rothead{\hfill Friday, January 3}     &
\rothead{\hfill Saturday, January 4}   &
\rothead{\hfill Sunday, January 5}     &
\rothead{\hfill Monday, January 6}     &
\rothead{\hfill Tuesday, January 7}    &
\rothead{\hfill Wednesday, January 8}  &
\rothead{\hfill Thursday, January 9}   &
\rothead{\hfill Friday, January 10}    \\
    \hline
\end{tabular}
    \end{center}
\end{document}

enter image description here

0

You need to specify the rotational origin; in this case, origin=r seems to be what you're after:

enter image description here

\documentclass{article}

\usepackage{graphicx,array}

\begin{document}

\newcolumntype{R}{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{0.32in}}

% other irrelevant preamble code

\begin{center}
  \setlength{\tabcolsep}{0pt}% Remove space between tabular columns
  \renewcommand{\arraystretch}{1.3}% Stretch rows vertically
  \begin{tabular}{ | *{10}{R |} }
    \multicolumn{10}{c}{\Huge January} \bigskip\\
    \hline
    \rotatebox[origin=r]{90}{~~~~~~~~Wednesday, January 1~~}   & 
      \rotatebox[origin=r]{90}{~~~~~~~~Thursday, January 2~~}  & 
      \rotatebox[origin=r]{90}{~~~~~~~~Friday, January 3~~}    & 
      \rotatebox[origin=r]{90}{~~~~~~~~Saturday, January 4~~}  & 
      \rotatebox[origin=r]{90}{~~~~~~~~Sunday, January 5~~}    & 
      \rotatebox[origin=r]{90}{~~~~~~~~Monday, January 6~~}    & 
      \rotatebox[origin=r]{90}{~~~~~~~~Tuesday, January 7~~}   & 
      \rotatebox[origin=r]{90}{~~~~~~~~Wednesday, January 8~~} & 
      \rotatebox[origin=r]{90}{~~~~~~~~Thursday, January 9~~}  & 
      \rotatebox[origin=r]{90}{~~~~~~~~Friday, January 10~~} \\
    \hline
  \end{tabular}
\end{center}

\end{document}
1
  • Hm...I copy and pasted your code, and it doesn't seem to have done anything with regards to the justification. Commented Jan 6, 2020 at 3:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .