1

I have created a longtable of 4 columns. As shown below. I would like to have the attribute on the first column, in this case "Business" vertical (sideways)instead of horizontal. What is the easiest way to achieve this?

Thank you in advance

\begin{longtable}[c]{| c | c |c | c|}


\hline
\rowcolor{orange}
\textbf{Category} & \textbf{Name} & Yes & No\\
\hline
\endfirsthead

\hline
\multicolumn{4}{|c|}{Continuation of Table \ref{long:hey}}\\
\hline
\rowcolor{orange}
\textbf{Category} & \textbf{Name} & Yes & No\\
\hline
\endhead

\hline
\endfoot
\endlastfoot

  \multirow{7}{*}{\textbf{Business}} & IreneVillas & \checkmark & \checkmark \\ \cline{2-4}
    & PhotoCorfu & \checkmark & \checkmark \\ \cline{2-4}
    & TradesManager & \checkmark & \checkmark \\ \cline{2-4}
    & CWE & \checkmark & \checkmark \\ \cline{2-4}
    & Akron & \checkmark & \checkmark \\ \cline{2-4}    
    & TVRepair & \checkmark & \checkmark \\ \cline{2-4}
    & Smart Scan  & \checkmark & \checkmark \\ \cline{2-4}

  \hline

   \caption{List of all business websites}\\  
\end{longtable}
5
  • Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Mike Renfro Apr 22 '16 at 14:31
  • @MikeRenfro code added :) – user3755632 Apr 22 '16 at 14:37
  • It isn't quite compilable or minimal (\checkmark probably irrelevant, for example), but adding the graphicx package and using \rotatebox{90}{\textbf{Business}} should work. – Mike Renfro Apr 22 '16 at 14:55
  • 1
    @MikeRenfro Wanna make that an answer? – Johannes_B May 8 '16 at 9:57
  • @Johannes_B done – Mike Renfro May 8 '16 at 14:37
1

Here's an example with the rotated labels via graphicx, some formatting cleanup from booktabs, and ensuring the longtable never breaks up a category:

enter image description here

\documentclass{article}
\usepackage{longtable}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{booktabs}

\begin{document}
\begin{longtable}[c]{cccc}

\toprule
\textbf{Category} & \textbf{Name} & Yes & No\\
\midrule
\endfirsthead

\multicolumn{4}{c}{Continuation of Table \ref{long:hey}}\\
\midrule
\textbf{Category} & \textbf{Name} & Yes & No\\
\midrule
\endhead

\caption{\label{long:hey} List of all business websites}
\endfoot
\bottomrule
\endlastfoot

  \multirow{7}{*}{\rotatebox{90}{\textbf{Business}}} & IreneVillas & x & x \\*
    & PhotoCorfu & x & x \\*
    & TradesManager & x & x \\*
    & CWE & x & x \\*
    & Akron & x & x \\*
    & TVRepair & x & x \\*
    & Smart Scan  & x & x \\*

  \midrule

  \multirow{7}{*}{\rotatebox{90}{\textbf{Business}}} & IreneVillas & x & x \\*
    & PhotoCorfu & x & x \\*
    & TradesManager & x & x \\*
    & CWE & x & x \\*
    & Akron & x & x \\*
    & TVRepair & x & x \\*
    & Smart Scan  & x & x \\*

  \midrule

  \multirow{7}{*}{\rotatebox{90}{\textbf{Business}}} & IreneVillas & x & x \\*
    & PhotoCorfu & x & x \\*
    & TradesManager & x & x \\*
    & CWE & x & x \\*
    & Akron & x & x \\*
    & TVRepair & x & x \\*
    & Smart Scan  & x & x \\*

  \midrule

  \multirow{7}{*}{\rotatebox{90}{\textbf{Business}}} & IreneVillas & x & x \\*
    & PhotoCorfu & x & x \\*
    & TradesManager & x & x \\*
    & CWE & x & x \\*
    & Akron & x & x \\*
    & TVRepair & x & x \\*
    & Smart Scan  & x & x \\*

  \midrule

  \multirow{7}{*}{\rotatebox{90}{\textbf{Business}}} & IreneVillas & x & x \\*
    & PhotoCorfu & x & x \\*
    & TradesManager & x & x \\*
    & CWE & x & x \\*
    & Akron & x & x \\*
    & TVRepair & x & x \\*
    & Smart Scan  & x & x \\*

  \midrule

  \multirow{7}{*}{\rotatebox{90}{\textbf{Business}}} & IreneVillas & x & x \\*
    & PhotoCorfu & x & x \\*
    & TradesManager & x & x \\*
    & CWE & x & x \\*
    & Akron & x & x \\*
    & TVRepair & x & x \\*
    & Smart Scan  & x & x \\*

\end{longtable}
\end{document}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.