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 turned the captions of my table by 90 degrees.

Unfortunately, the headings do not fit to the table contents. Screenshot:

enter image description here

Can this be changed? I already tried parbox but that did not work.

Here is my table:

\begin{tabular}{cccc}       

    \noalign{\vskip\doublerulesep}

    & CSS & Canvas & SVG

    \tabularnewline[\doublerulesep]

    \multirow{1}{*}{\rotatebox{90}{\mbox{Google Chrome}}} 
    & \includegraphics[scale=0.7]{images/screenshots/chrome_css3}
    & \includegraphics[scale=0.7]{images/screenshots/chrome_canvas}
    & \includegraphics[scale=0.7]{images/screenshots/chrome_svg}    

    \tabularnewline[\doublerulesep]

    \multirow{1}{*}{\rotatebox{90}{\mbox{Opera}}} 
    & \includegraphics[scale=0.7]{images/screenshots/opera_css3}    
    & \includegraphics[scale=0.7]{images/screenshots/opera_canvas}
    & \includegraphics[scale=0.7]{images/screenshots/opera_svg} 

    \tabularnewline[\doublerulesep]

    \multirow{1}{*}{\rotatebox{90}{\mbox{Mozilla Firefox}}} 
    & \includegraphics[scale=0.7]{images/screenshots/firefox_css3}  
    & \includegraphics[scale=0.7]{images/screenshots/firefox_canvas}
    & \includegraphics[scale=0.7]{images/screenshots/firefox_svg}   

    \tabularnewline[\doublerulesep]

    \multirow{1}{*}{\rotatebox{90}{\mbox{Apple Safari}}} 
    & \includegraphics[scale=0.7]{images/screenshots/safari_css3}   
    & \includegraphics[scale=0.7]{images/screenshots/safari_canvas}
    & \includegraphics[scale=0.7]{images/screenshots/safari_svg}    

\end{tabular}

Relevant posts here on Stack Exchange could not help me.

Am I using multirow wrong?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

This is similar to @HarishKumar 's approach. But to get the titles to center on the rows, I set the height of the images.

Here though, I set the image height; the graphicx package will scale the width appropriately. This allows you to label your rows and center them manually as I have done by bracketing the content between two \hspace*{\fill}.

\documentclass{article}
\usepackage{graphicx}
\usepackage[margin=1in]{geometry}
\begin{document}
  \renewcommand{\arraystretch}{1.2}
  \begin{tabular}{cccc}

    \noalign{\vskip\doublerulesep}

    & CSS & Canvas & SVG

    \tabularnewline[4ex]

    \rotatebox{90}{\parbox[t]{1.25in}{\hspace*{\fill}Google Chrome\hspace*{\fill}}}
    & \fbox{\rotatebox[origin=c]{-45}{\includegraphics[totalheight=1.25in]{example-image-10x16}}}
    & \fbox{\rotatebox[origin=c]{-45}{\includegraphics[totalheight=1.25in]{example-image-10x16}}}
    & \fbox{\rotatebox[origin=c]{-45}{\includegraphics[totalheight=1.25in]{example-image-10x16}}}

    \tabularnewline[4ex]

     \rotatebox{90}{\parbox[t]{1.25in}{\hspace*{\fill}Opera\hspace*{\fill}}}
    & \fbox{\rotatebox[origin=c]{-45}{\includegraphics[totalheight=1.25in]{example-image-10x16}}}
    & \fbox{\rotatebox[origin=c]{-45}{\includegraphics[totalheight=1.25in]{example-image-10x16}}}
    & \fbox{\rotatebox[origin=c]{-45}{\includegraphics[totalheight=1.25in]{example-image-10x16}}}

    \tabularnewline[4ex]

     \rotatebox{90}{\parbox[t]{1.25in}{\hspace*{\fill}Mozilla Firefox\hspace*{\fill}}}
    & \fbox{\rotatebox[origin=c]{-45}{\includegraphics[totalheight=1.25in]{example-image-10x16}}}
    & \fbox{\rotatebox[origin=c]{-45}{\includegraphics[totalheight=1.25in]{example-image-10x16}}}
    & \fbox{\rotatebox[origin=c]{-45}{\includegraphics[totalheight=1.25in]{example-image-10x16}}}

    \tabularnewline[4ex]

     \rotatebox{90}{\parbox[t]{1.25in}{\hspace*{\fill}Apple Safari\hspace*{\fill}}}
    & \fbox{\rotatebox[origin=c]{-45}{\includegraphics[totalheight=1.25in]{example-image-10x16}}}
    & \fbox{\rotatebox[origin=c]{-45}{\includegraphics[totalheight=1.25in]{example-image-10x16}}}
    & {\includegraphics[height=1.25in]{example-image-10x16}}

\end{tabular}
\end{document}

enter image description here

I don't have the images you refer to. So, I don't know whether they're already rotated or not. What that means is that you may not need to use the \rotatebox on the \includegraphics calls. If you don't need to make that call, then you can change totalheight to just straight height. Though a word of caution, the images don't scale as you expect if you pass demo to the graphicx package: hence my call to the image from the mwe package.

I believe that part of what's happening with your alignment is that you're center on the baseline of the image, which is the bottom of the image.

I've mucked around a bit with your multirow approach. I'm not able to get a satisfactory looking result. So I'd suggest just dispensing with that idea.

share|improve this answer
    
It has worked. The text is nicely centered. Thanks for that! A \ rotatebox was not necessary. My images are already rotated. But good to know that it is possible! –  Benny Neugebauer Feb 21 '13 at 22:31

You don't need multirow, parbox will do it.:

\documentclass{article}
\usepackage[demo]{graphicx}
\begin{document}
  \begin{tabular}{cccc}

    \noalign{\vskip\doublerulesep}

    & CSS & Canvas & SVG

    \tabularnewline[\doublerulesep]

    \rotatebox{90}{\parbox[t]{1in}{Google Chrome}}
    & \includegraphics[width=1in]{images/screenshots/chrome_css3}
    & \includegraphics[width=1in]{images/screenshots/chrome_canvas}
    & \includegraphics[width=1in]{images/screenshots/chrome_svg}

    \tabularnewline[\doublerulesep]

     \rotatebox{90}{\parbox[t]{1in}{Opera}}
    & \includegraphics[width=1in]{images/screenshots/opera_css3}
    & \includegraphics[width=1in]{images/screenshots/opera_canvas}
    & \includegraphics[width=1in]{images/screenshots/opera_svg}

    \tabularnewline[\doublerulesep]

     \rotatebox{90}{\parbox[t]{1in}{Mozilla Firefox}}
    & \includegraphics[width=1in]{images/screenshots/firefox_css3}
    & \includegraphics[width=1in]{images/screenshots/firefox_canvas}
    & \includegraphics[width=1in]{images/screenshots/firefox_svg}

    \tabularnewline[\doublerulesep]

     \rotatebox{90}{\parbox[t]{1in}{Apple Safari}}
    & \includegraphics[width=1in]{images/screenshots/safari_css3}
    & \includegraphics[width=1in]{images/screenshots/safari_canvas}
    & \includegraphics[width=1in]{images/screenshots/safari_svg}

\end{tabular}
\end{document}

enter image description here

share|improve this answer
    
Thanks for the answer! –  Benny Neugebauer Feb 21 '13 at 22:29

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.