-2

I want to create a table in LaTeX that looks exacly like the following:

I already tried some things but I find it difficult to get the rotated caption right in addidion with the headers (header a, b and c). Also, I want to include this table in a document with a lot of text and make sure it has textwidth. The command {\textwidth} threw an error in my case. Additionally, I am also struggling with having text over multiple rows in the same field.

Any hints will be appreciated a lot! Ideal would be a solution that solves all my problems and is easy to adapt (since I only used placeholder text of course). Please no solutions where any lengths are hardcoded.

I already tried the following:

\begin{center}
 \begin{table}
 \centering
 \begin{tabular}{|c|l|r|r|r|r|}
 \hline
 & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{Text} & \multicolumn{1}{c|}{Text} & \multicolumn{1}{c|}{Text} & \multicolumn{1}{c|}{text}\\
 \hline
\parbox[p]{2mm}{\multirow{9}{*}{\rotatebox[origin=c]{90}{long caption here}}} & &&&&\\
\hline
& text text text text & jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj&&&\\
\hline
& text text text text & a lot of text here hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh&&&\\
 \hline
 \end{tabular}
 \end{table}

\end{center}

However, this has two problems:

  1. the caption is outside the box
  2. my table is way too big to fit in my document - I want it to have textwidth. I tried adding {\textwidth} after \begin{center}, but this did not help. I am new to LaTeX so I am struggling with searching for the right concepts. I would appreaciate tipps what to look for or how to solve my problems.
Katja
  • 11
  • 1
    Welcome to TeX.SE! Please show us the code you have tried so far! Then we do not have to guess what you are doing ... – Mensch Oct 26 '21 at 11:44
  • 2
    @downvoters: Please don't downvote below a score of -1, even if the question in its current form needs some improvement. A score of -1 is enough to show that the question needs work, anything below that is of no use. Also, if you downvote or vote to close, please leave a comment explaining why you did so, but wait at least 24 hours after asking the OP for improvements to the question before voting to close. – Mensch Oct 26 '21 at 12:09
  • As @Mensch already said, please add a minimum workable example which includes the code you have tried so far to create this table including the document class and the packages that were used. Then the users of this site will be able to help you better. – Imran Oct 26 '21 at 12:48
  • Also, you may take a look at the answers to this question (self-advertisement: I have one answer there too ). The table there has some similarities with yours. – Imran Oct 26 '21 at 12:59

1 Answers1

0

You should google more: one two and so on

 \documentclass{article}
 \usepackage{array,multirow,graphicx}
 \usepackage{float}
 \begin{document}
 \begin{table}[H]
 \centering
 \begin{tabular}{|c|l|r|r|r|r|}
 \hline
 & \multicolumn{1}{c|}{Text} & \multicolumn{1}{c|}{Text} & \multicolumn{1}{c|}{Text} & \multicolumn{1}{c|}{Text} & \multicolumn{1}{c|}{text}\\
 \hline
\parbox[p]{2mm}{\multirow{9}{*}{\rotatebox[origin=c]{90}{YOUR CAPTION}}} & text &&&&\\
& text &&&&\\
& text &&&&\\
& text &&&&\\
& text &&&&\\
& text &&&&\\
& text &&&&\\
& text &&&&\\
& text &&&&\\
 \hline
 \end{tabular}
 \end{table}
 \end{document}

enter image description here

WinnieNotThePooh
  • 3,008
  • 1
  • 7
  • 14