1

I need that text CT1 1mm and the other CT... was rotated and in multirow for two rows. A I dont know how to do that. Many thanks :)

\documentclass[12pt]{article}
\usepackage{amsmath,amssymb}
\usepackage[dvipsnames]{xcolor}
\usepackage[geometry]{ifsym}
\usepackage{multirow}
  \begin{document}


\begin {table} [H]
\centering 
\begin{tabular}{|P{1cm}|P{4cm}|P{3cm}|P{2cm}|P{2cm}|}
\hline
&       &   Objem z DVH &   a   &   $V_{exp}$   \\
&       &   [$cm^{3}$]  &   [cm]    &   [$cm^{3}$]  \\
\hline
CT1 1mm &   Medzi $10$ a $9,5 Gy$   &   7,82    &   0,97    &   8,73    \\
&   Medzi $10,5$ a $10 Gy$  &   8,3 &   0,91    &   8,19    \\
\hline
CT1 3mm &   Medzi $10$ a $9,5 Gy$   &   7,31    &   1   &   9   \\
&   Medzi $10,5$ a $10 Gy$  &   8,43    &   0,98    &   8,82    \\
\hline
CT2 1mm &   Medzi $10$ a $9,5 Gy$   &   8,02    &   1,01    &   9,09    \\
&   Medzi $10,5$ a $10 Gy$  &   8,73    &   0,97    &   8,73    \\
\hline
CT2 3mm &   Medzi $10$ a $9,5 Gy$   &   7,57    &   0,96    &   8,64    \\
&   Medzi $10,5$ a $10 Gy$  &   7,91    &   0,91    &   8,19    \\
\hline

\hline
\end{tabular}
\caption{table}
\label{table}
\end {table}
2

2 Answers 2

1

I propose three solutions, with the rotated titles on two centred lines. I load tabularx,makecellto improve padding of cells and allow line breaks in cells,booktabs` in two solutions:

\documentclass[12pt]{article}
\usepackage{geometry} \usepackage{mathtools,amssymb}
\usepackage[dvipsnames]{xcolor}
\usepackage[geometry]{ifsym}
\usepackage{multirow, tabularx, makecell, rotating, graphicx, siunitx, booktabs}
\newcommand\rottitle[2]{\multirowcell{#1}{\rotatebox[origin =r]{90}{\begin{tabular}{@{}c@{}}#2\end{tabular}}}}%
  \begin{document}


\begin {table}%
\centering\sisetup{table-format=1.2, table-number-alignment=center}
\setcellgapes{4pt}\makegapedcells
\begin{tabularx}{0.8\linewidth}{|c|X|*{3}{S|}}
  \hline
                   & & {\makecell{Objem z DVH & & \\{} [\si{cm³}]}} & {\makecell{a \\{} [cm]}} & {\makecell{$V_{\text{exp}}$ \\{}[\si{cm³}]}}\\
  \hline
  \rottitle{2}{CT1 & & & & \\ 1\,mm} & Medzi $10$ a $9,5 Gy$ & 7,82 & 0,97 & 8,73 \\
                   & Medzi $10,5$ a $10 Gy$ & 8,3 & 0,91 & 8,19 \\
  \hline
  \rottitle{2}{CT1\\ 3\,mm}%
                   & Medzi $10$ a $9,5 Gy$ & 7,31 & 1 & 9 \\
                   & Medzi $10,5$ a $10 Gy$ & 8,43 & 0,98 & 8,82 \\
  \hline
  \rottitle{2}{CT2 & & & & \\ 1\,mm} & Medzi $10$ a $9,5 Gy$ & 8,02 & 1,01 & 9,09 \\
                   & Medzi $10,5$ a $10 Gy$ & 8,73 & 0,97 & 8,73 \\
  \hline
  \rottitle{2}{CT2 & & & & \\ 3\,mm }& Medzi $10$ a $9,5 Gy$ & 7,57 & 0,96 & 8,64 \\
                   & Medzi $10,5$ a $10 Gy$ & 7,91 & 0,91 & 8,19 \\
  \hline
  \hline
\end{tabularx}
\caption{table}
\label{table}
\end {table}

\begin {table}% [H]
\centering\sisetup{table-format=1.2, table-number-alignment=center}
\setcellgapes{3pt}\makegapedcells
\begin{tabularx}{0.8\linewidth}{cX*{3}{S}}
                   & & {\makecell{Objem z DVH & & \\{} [\si{cm³}]}} & {\makecell{a \\{} [cm]}} & {\makecell{$V_{\text{exp}}$\\{} [\si{cm³}]}}\\
  \toprule
  \rottitle{2}{CT1 & & & & \\ 1\,mm} & Medzi $10$ a $9,5 Gy$ & 7,82 & 0,97 & 8,73 \\
                   & Medzi $10,5$ a $10 Gy$ & 8,3 & 0,91 & 8,19 \\
  \addlinespace
  \rottitle{2}{CT1\\ 3\,mm}%
                   & Medzi $10$ a $9,5 Gy$ & 7,31 & 1 & 9 \\
                   & Medzi $10,5$ a $10 Gy$ & 8,43 & 0,98 & 8,82 \\
  \cmidrule(lr){1-5}
  \rottitle{2}{CT2 & & & & \\ 1\,mm} & Medzi $10$ a $9,5 Gy$ & 8,02 & 1,01 & 9,09 \\
                   & Medzi $10,5$ a $10 Gy$ & 8,73 & 0,97 & 8,73 \\
  \addlinespace
  \rottitle{2}{CT2 & & & & \\ 3\,mm }& Medzi $10$ a $9,5 Gy$ & 7,57 & 0,96 & 8,64 \\
                   & Medzi $10,5$ a $10 Gy$ & 7,91 & 0,91 & 8,19 \\
  \bottomrule
\end{tabularx}
\caption{table}
\label{table}
\end {table}

\begin {table}% [H]
\centering\sisetup{table-format=1.2, table-number-alignment=center}
\setcellgapes{3pt}\makegapedcells
\begin{tabularx}{0.8\linewidth}{cX*{3}{S}}
                   & & {\makecell{Objem z DVH & & \\{} [\si{cm³}]}} & {\makecell{a \\{} [cm]}} & {\makecell{$V_{\text{exp}}$\\{} [\si{cm³}]}}\\
  \cmidrule[\heavyrulewidth]{2-5}
  \rottitle{2}{CT1 & & & & \\ 1\,mm} & Medzi $10$ a $9,5 Gy$ & 7,82 & 0,97 & 8,73 \\
                   & Medzi $10,5$ a $10 Gy$ & 8,3 & 0,91 & 8,19 \\
  \cmidrule(lr){2-5}
  \rottitle{2}{CT1\\ 3\,mm}%
                   & Medzi $10$ a $9,5 Gy$ & 7,31 & 1 & 9 \\
                   & Medzi $10,5$ a $10 Gy$ & 8,43 & 0,98 & 8,82 \\
  \cmidrule(lr){2-5}
  \morecmidrules
  \cmidrule(lr){2-5}
  \rottitle{2}{CT2 & & & & \\ 1\,mm} & Medzi $10$ a $9,5 Gy$ & 8,02 & 1,01 & 9,09 \\
                   & Medzi $10,5$ a $10 Gy$ & 8,73 & 0,97 & 8,73 \\
  \cmidrule(lr){2-5}
  \rottitle{2}{CT2 & & & & \\ 3\,mm }& Medzi $10$ a $9,5 Gy$ & 7,57 & 0,96 & 8,64 \\
                   & Medzi $10,5$ a $10 Gy$ & 7,91 & 0,91 & 8,19 \\
  \cmidrule[\heavyrulewidth]{2-5}
\end{tabularx}
\caption{table}
\label{table}
\end {table}

\end{document} 

enter image description here enter image description here

2

Well, I suspect that you like to obtain something like this:

enter image description here

For above table I add two packages: makecell, rotating and siunitx, instead (unknown) P{...} use standard c, l and S[...] from siunitx. For rotating of cells contents in the first column \the\rotheadfrom packagemakecell` is used. Hopefully, the code is self explanatory ...

    \documentclass[12pt]{article}
    \usepackage{amsmath,amssymb}
    %\usepackage[dvipsnames]{xcolor}
    %\usepackage[geometry]{ifsym}

    \usepackage{siunitx}
    \usepackage{makecell,multirow,rotating}
    \renewcommand\theadfont{\normalsize}
    \settowidth\rotheadsize{\theadfont 1 mm}

      \begin{document}
    \begin {table}[htb]
    \renewcommand{\arraystretch}{1.1}
        \centering
    \begin{tabular}{|c|l|*{3}{S[table-format=2.3]|}}
        \hline
    &       &   {\thead{Objem z DVH\\ {[\si{cm^3}]}}}
                &   {\thead{a\\{[\si{cm^3}]}}}
                    &   {\thead{$V_{exp}$\\ {[\si{cm^3}]}}}                  \\
   \hline
    \multirow{2}*[1ex]{\rothead{CT1 1mm}}
            &   Medzi $10$ a $9,5 Gy$   &   7,82    &   0,97    &   8,73    \\
            &   Medzi $10,5$ a $10 Gy$  &   8,3     &   0,91    &   8,19    \\
        \hline
    \multirow{2}*[1ex]{\rothead{CT1 3mm}}
            &   Medzi $10$ a $9,5 Gy$   &   7,31    &   1   &   9   \\
            &   Medzi $10,5$ a $10 Gy$  &   8,43    &   0,98    &   8,82    \\
        \hline
    \multirow{2}*[1ex]{\rothead{CT2 1mm}}
            &   Medzi $10$ a $9,5 Gy$   &   8,02    &   1,01    &   9,09    \\
            &   Medzi $10,5$ a $10 Gy$  &   8,73    &   0,97    &   8,73    \\
        \hline
    \multirow{2}*[1ex]{\rothead{CT2 3mm}}
            &   Medzi $10$ a $9,5 Gy$   &   7,57    &   0,96    &   8,64    \\
            &   Medzi $10,5$ a $10 Gy$  &   7,91    &   0,91    &   8,19    \\
        \hline
        \hline
    \end{tabular}
    \caption{My very important and nice table}
    \label{table}
    \end {table}
        \end{document}

With use of booktabs rules and omitting vertical rules table would be more appealing:

enter image description here

You must log in to answer this question.

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