3

I have a table with an empty first column. All the other columns are filled with text or formulae. I want to write the words "DC grid" vertically over the whole first column except for the first two rows (which are already used) without changing the overall look of my table.

The problem is, I cannot simply use \multirow because I want to write over several cells (not just rows). I tried to do tables inside tables (nested tables) but I can't get rid of the additional space added by the nested table.

Here is my table (I want to write "DC grid" vertically in the empty first column):

enter image description here

\begin{table}[!htbp]%200pts de large
\centerline{\resizebox{0.90\linewidth}{!}{\begin{tabular}
{|>{\centering}p{15pt}|>{\centering}p{25pt}|>{\centering}p{55pt}|>{\centering}p{20pt}|>{\centering}p{23pt}|>{\centering}p{70pt}|}\hline %\pm
%
\multicolumn{3}{|c|}{\multirow{2}{*}{\textbf{Eigenvalues}}} & \textbf{Freq. (Hz)} & \textbf{Damp. ratio} & \centering \multirow{2}{*}{\textbf{Dominant states}}\tabularnewline\hline
%
 & \multirow{1}{*}{$\lambda_{dc_{1,2}}$} & \multirow{1}{*}{$-56.7 \pm j2130$} & \multirow{1}{*}{$339$} & \multirow{1}{*}{$0.027$} & $X_{p_1}$, $X_{p_2}$, $X_{p_3}$,  \tabularnewline\cline{2-5}
%
 & \multirow{1}{*}{$\lambda_{dc_{2,3}}$} & \multirow{1}{*}{$-56.7 - j2011$} & \multirow{1}{*}{$320$} & \multirow{1}{*}{$0.028$} & $\Delta u_{s_1}$, $\Delta u_{s_2}$, $\Delta u_{s_3}$ \tabularnewline\cline{2-5}
%
 & \multirow{1}{*}{$\lambda_{dc_{5,6}}$} & \multirow{1}{*}{$-60.0 \pm j1426$} & \multirow{1}{*}{$227$} & \multirow{1}{*}{$0.040$} &  $\Delta u_{s_4}$, $\Delta u_{s_5}$\tabularnewline\cline{2-6}
%
 & \multirow{4}{*}{$\lambda_{dc_{7,8}}$} & \multirow{4}{*}{$-57 \pm j1223$} & \multirow{4}{*}{$195$} & \multirow{4}{*}{$0.047$} & $i_{l_{1_1}}$, $i_{l_{2_1}}$, $i_{l_{1_4}}$, $i_{l_{2_4}}$, $i_{l_{1_5}}$, $i_{l_{2_5}}$\vspace{0.4mm}, $\Delta u_{s_1}$, $\Delta u_{s_2}$, $\Delta u_{s_3}$, $\Delta u_{s_4}$, $\Delta u_{s_5}$\tabularnewline\cline{2-6} 
%
 & \multirow{1}{*}{$\lambda_{dc_{9}}$} & \multirow{1}{*}{$-117.1$} & \multirow{1}{*}{ -- } & \multirow{1}{*}{ -- } & $i_{l_{1_1}}$, $i_{l_{2_1}}$, $i_{l_{1_2}}$,\tabularnewline\cline{2-5}
%
 & \multirow{1}{*}{$\lambda_{dc_{10}}$} & \multirow{1}{*}{$-4.497$} & \multirow{1}{*}{ -- } & \multirow{1}{*}{ -- } & $i_{l_{2_2}}$, $i_{l_{1_3}}$, $i_{l_{2_3}}$,\tabularnewline\cline{2-5}
%
 & \multirow{1}{*}{$\lambda_{dc_{11}}$} & \multirow{1}{*}{$-4.476$} & \multirow{1}{*}{ -- } & \multirow{1}{*}{ -- } & $i_{l_{1_4}}$, $i_{l_{2_4}}$, $i_{l_{1_5}}$,\tabularnewline\cline{2-5}
%
 & \multirow{1}{*}{$\lambda_{dc_{12}}$} & \multirow{1}{*}{$-0.604$} & \multirow{1}{*}{ -- } & \multirow{1}{*}{ -- } & $i_{l_{2_5}}$, $i_{l_{1_6}}$, $i_{l_{2_6}}$,\tabularnewline\cline{1-6}
%
%
\end{tabular}}}\vspace{3mm}
\caption{Modal Analysis of the 5-Terminal HVDC Grid}\label{tab5}\end{table}%
Null
  • 1,525
VieuxSinge
  • 159
  • 1
  • 12

2 Answers2

7

You mean like this?

\documentclass{Article}
\usepackage{multirow,graphicx,array}
\begin{document}
  \begin{table}[!htbp]
\centering                              %% use this instead of \centerline
\resizebox{0.90\linewidth}{!}{\begin{tabular}
{|>{\centering}p{15pt}|>{\centering}p{25pt}|>{\centering}p{63pt}|>{\centering}p{26pt}|
           >{\centering}p{33pt}|>{\centering}p{83pt}|}\hline %\pm
%
\multicolumn{3}{|c|}{\multirow{2}{*}{\textbf{Eigenvalues}}} & \textbf{Freq. (Hz)} & \textbf{Damp. ratio} & \centering \multirow{2}{*}{\textbf{Dominant states}}\tabularnewline\hline
%
 & \multirow{1}{*}{$\lambda_{dc_{1,2}}$} & \multirow{1}{*}{$-56.7 \pm j2130$} & \multirow{1}{*}{$339$} & \multirow{1}{*}{$0.027$} & $X_{p_1}$, $X_{p_2}$, $X_{p_3}$,  \tabularnewline\cline{2-5}
%
 & \multirow{1}{*}{$\lambda_{dc_{2,3}}$} & \multirow{1}{*}{$-56.7 - j2011$} & \multirow{1}{*}{$320$} & \multirow{1}{*}{$0.028$} & $\Delta u_{s_1}$, $\Delta u_{s_2}$, $\Delta u_{s_3}$ \tabularnewline\cline{2-5}
%
 & \multirow{1}{*}{$\lambda_{dc_{5,6}}$} & \multirow{1}{*}{$-60.0 \pm j1426$} & \multirow{1}{*}{$227$} & \multirow{1}{*}{$0.040$} &  $\Delta u_{s_4}$, $\Delta u_{s_5}$\tabularnewline\cline{2-6}
%
 & \multirow{4}{*}{$\lambda_{dc_{7,8}}$} & \multirow{4}{*}{$-57 \pm j1223$} & \multirow{4}{*}{$195$} & \multirow{4}{*}{$0.047$} & $i_{l_{1_1}}$, $i_{l_{2_1}}$, $i_{l_{1_4}}$, $i_{l_{2_4}}$, $i_{l_{1_5}}$, $i_{l_{2_5}}$\vspace{0.4mm}, $\Delta u_{s_1}$, $\Delta u_{s_2}$, $\Delta u_{s_3}$, $\Delta u_{s_4}$, $\Delta u_{s_5}$\tabularnewline\cline{2-6}
%
 & \multirow{1}{*}{$\lambda_{dc_{9}}$} & \multirow{1}{*}{$-117.1$} & \multirow{1}{*}{ -- } & \multirow{1}{*}{ -- } & $i_{l_{1_1}}$, $i_{l_{2_1}}$, $i_{l_{1_2}}$,\tabularnewline\cline{2-5}
%
 & \multirow{1}{*}{$\lambda_{dc_{10}}$} & \multirow{1}{*}{$-4.497$} & \multirow{1}{*}{ -- } & \multirow{1}{*}{ -- } & $i_{l_{2_2}}$, $i_{l_{1_3}}$, $i_{l_{2_3}}$,\tabularnewline\cline{2-5}
%
 & \multirow{1}{*}{$\lambda_{dc_{11}}$} & \multirow{1}{*}{$-4.476$} & \multirow{1}{*}{ -- } & \multirow{1}{*}{ -- } & $i_{l_{1_4}}$, $i_{l_{2_4}}$, $i_{l_{1_5}}$,\tabularnewline\cline{2-5}
%
\multirow{-11}{*}{\rotatebox[origin=c]{90}{DC Grid}}     %% change 11 as you add further rows and put this in the last row.
 & \multirow{1}{*}{$\lambda_{dc_{12}}$} & \multirow{1}{*}{$-0.604$} & \multirow{1}{*}{ -- } & \multirow{1}{*}{ -- } & $i_{l_{2_5}}$, $i_{l_{1_6}}$, $i_{l_{2_6}}$,\tabularnewline\cline{1-6}
%
%
\end{tabular}}%\vspace{3mm}
\caption{Modal Analysis of the 5-Terminal HVDC Grid}\label{tab5}
\end{table}%
\end{document}

enter image description here

  • Exactly! Thank you so much, it works! I need to understand why it works with a negative value in multirow though

    Thank you again!

    – VieuxSinge Mar 04 '15 at 17:20
5

You can have a much simpler code, using the makecell package. The caption package helps getting a caption like the image in the O.P.'s question. However, I suggest another layout using booktabs, with no vertical lines. The code below shows both layouts:

\documentclass{article}

\usepackage{multirow,graphicx}
\usepackage{mathtools}
\usepackage{makecell, booktabs}
\renewcommand\theadfont{\bfseries}
\renewcommand\cellalign{lc}
\setcellgapes{2pt}
\usepackage{array}
\usepackage{caption}
\DeclareCaptionLabelFormat{uppercase}{\MakeUppercase{#1}~\Roman{table}}
\captionsetup{textfont=sc, labelformat=uppercase, labelsep=newline}
\begin{document}
\setcounter{table}{3}
  \begin{table}[!htbp]
\centering \makegapedcells%%
\resizebox{0.90\linewidth}{!}{%
 $ \begin{array}{|>{\centering}p{15pt}|c|c|c|c|>{\centering\arraybackslash $}p{90pt}<{$}|}
 \hline %
\multicolumn{3}{|c|}{\thead{\text{Eigenvalues}}}& \thead{\text{Freq.}\\ \text{(Hz)}} & \thead{\text{Damp.}\\ \text{ratio}} & \thead{\text{Dominant states}} \\
\hline
 & \lambda_{dc_{1,2}} & -56.7 \pm j2130 & 339 & 0.027 & \multirowcell{4}[0.3ex]{
 X_{p_1}, X_{p_2}, X_{p_3} , \\ \Delta u_{s_1}, \Delta u_{s_2}, \Delta u_{s_3}, \\ \Delta u_{s_4}, \Delta u_{s_5}} \\
\cline{2-5}
%
 & \lambda_{dc_{2,3}} & -56.7 - j2011 & 320 & 0.028 & \\
 \cline{2-5}
%
 & \lambda_{dc_{5,6}} & -60.0 \pm j1426 & 227 & 0.040 & \\
 \cline{2-6}
%
\rotatebox[origin=c]{90}{DC Grid} & \lambda_{dc_{7,8}} & -57 \pm j1223 & 195 & 0.047 & \makecell{ i_{l_{1_1}}, i_{l_{2_1}}, i_{l_{1_4}}, i_{l_{2_4}},\\ i_{l_{1_5}}, i_{l_{2_5}}, \Delta u_{s_1}, \Delta u_{s_2},\\ \Delta u_{s_3}, \Delta u_{s_4}, \Delta u_{s_5}\bigskip} \\
 \cline{2-6}
%
 & \lambda_{dc_{9}} & -117.1 & \textendash & \textendash & \multirowcell{4}[-1ex]{ i_{l_{1_1}}, i_{l_{2_1}}, i_{l_{1_2}}, i_{l_{2_2}}, \\ i_{l_{1_3}}, i_{l_{2_3}}, i_{l_{1_4}}, i_{l_{2_4}}, \\ i_{l_{1_5}}, i_{l_{2_5}}, i_{l_{1_6}}, i_{l_{2_6}}} \\
 \cline{2-5}
%
 & \lambda_{dc_{10}} & -4.497 & \textendash & \textendash & \\
 \cline{2-5}
%
 & \lambda_{dc_{11}} & -4.476 & \textendash & \textendash & \\
 \cline{2-5}
%
 & \lambda_{dc_{12}} & -0.604 & \textendash & \textendash & \\
 \cline{1-6}%
\end{array} $}%
\caption{Modal Analysis of the 5-Terminal HVDC Grid}\label{tab5}
\end{table}%
\vskip 0.5cm

  \begin{table}[!htbp]
\centering \makegapedcells%%
\resizebox{0.90\linewidth}{!}{%
 $ \begin{array}{c*{4}{c}>{\centering\arraybackslash $}p{90pt}<{$}}
 & \multicolumn{2}{c}{\thead{\text{Eigenvalues}}}& \thead{\text{Freq.}\\ \text{(Hz)}} & \thead{\text{Damp.}\\ \text{ratio}} & \thead{\text{Dominant states}} \\
 \addlinespace[-1ex]
\cmidrule[\heavyrulewidth]{2-6}
 & \lambda_{dc_{1,2}} & -56.7 \pm j2130 & 339 & 0.027 & \multirowcell{4}[0.5ex]{
 X_{p_1}, X_{p_2}, X_{p_3} , \\ \Delta u_{s_1}, \Delta u_{s_2}, \Delta u_{s_3}, \\ \Delta u_{s_4}, \Delta u_{s_5}} \\
 & \lambda_{dc_{2,3}} & -56.7 - j2011 & 320 & 0.028 & \\
%
 & \lambda_{dc_{5,6}} & -60.0 \pm j1426 & 227 & 0.040 & \\
 \cmidrule(lr){2-6}
%
\rotatebox[origin=c]{90}{DC Grid} & \lambda_{dc_{7,8}} & -57 \pm j1223 & 195 & 0.047 & \makecell{ i_{l_{1_1}}, i_{l_{2_1}}, i_{l_{1_4}}, i_{l_{2_4}},\\ i_{l_{1_5}}, i_{l_{2_5}}, \Delta u_{s_1}, \Delta u_{s_2},\\ \Delta u_{s_3}, \Delta u_{s_4}, \Delta u_{s_5}} \\
 \cmidrule(lr){2-6}
%
 & \lambda_{dc_{9}} & -117.1 & \textendash & \textendash & \multirowcell{4}[-1ex]{ i_{l_{1_1}}, i_{l_{2_1}}, i_{l_{1_2}}, i_{l_{2_2}}, \\ i_{l_{1_3}}, i_{l_{2_3}}, i_{l_{1_4}}, i_{l_{2_4}}, \\ i_{l_{1_5}}, i_{l_{2_5}}, i_{l_{1_6}}, i_{l_{2_6}}} \\
%
 & \lambda_{dc_{10}} & -4.497 & \textendash & \textendash & \\
%
 & \lambda_{dc_{11}} & -4.476 & \textendash & \textendash & \\
%
 & \lambda_{dc_{12}} & -0.604 & \textendash & \textendash & \\
 \cmidrule[\heavyrulewidth]{2-6}
\end{array} $}%
\caption{Modal Analysis of the 5-Terminal HVDC Grid}\label{tab5-a}
\end{table}%

\end{document}

enter image description here

enter image description here

Bernard
  • 271,350