0

I would appreciate the suggestion to centering the text im a multirow environemnt. In the table below the multirow text "blah blah blah blah blah blah blah bla" is NOT centered over the nine rows that it spans.

\begin{table}[]
\centering
\caption{}
\label{tab:my-table}
\resizebox{\textwidth}{!}{%
\begin{tabular}{@{}ccccccll@{}}
\toprule
\textbf{Ref.} &
  \textbf{Time} &
  \textbf{\begin{tabular}[c]{@{}c@{}}Specs\\ Selection\end{tabular}} &
  \textbf{\begin{tabular}[c]{@{}c@{}}Specs\\ Selection\end{tabular}} &
  \textbf{\begin{tabular}[c]{@{}c@{}}Specs\\ Selection\end{tabular}} &
  \textbf{\begin{tabular}[c]{@{}c@{}}Specs\\ Selection\end{tabular}} &
  \multicolumn{1}{c}{\textbf{\begin{tabular}[c]{@{}c@{}}Specs\\ Selection\end{tabular}}} &
  \multicolumn{1}{c}{\textbf{\begin{tabular}[c]{@{}c@{}}Specs\\ Selection\end{tabular}}} \\ \midrule
1 &
  20159 &
  \ding{55} &
  \ding{55} &
  \ding{51} &
  \ding{51} &
  - Demand side management &
  \multirow{9}{*}{\begin{tabular}[c]{@{}l@{}}blah blah blah blah blah blah blah blah\\ bbbbb bbb bbbbb bbbb bbbbbb bbbbb \\ bbbb bbbbbbbbbbb bbbbbbbbbbbbb bb\\ bbb bbb bbbbb bbbb bbbb bbbb bbb bb\\ bbb bbbbb bbbb bbbb bbbbb bbbb bbb \\ bbb bbb bbb bbb bbb bbb bbb bb bbb\end{tabular}} \\ \cmidrule(r){1-7}
2    & 2018 & \ding{55} & \ding{55} & \ding{51} & \ding{51} & - Demand side management &  \\ \cmidrule(r){1-7}
3    & 2014 & \ding{55} & \ding{55} & \ding{51} & \ding{51} & - Demand side management &  \\ \cmidrule(r){1-7}
4    & 2017 & \ding{55} & \ding{55} & \ding{51} & \ding{51} & - Demand side management &  \\ \cmidrule(r){1-7}
5    & 2017 & \ding{55} & \ding{55} & \ding{51} & \ding{51} & - Demand side management &  \\ \cmidrule(r){1-7}
6    & 2017 & \ding{55} & \ding{55} & \ding{51} & \ding{51} & - Demand side management &  \\ \cmidrule(r){1-7}
7    & 2016 & \ding{55} & \ding{55} & \ding{51} & \ding{51} & - Demand side management &  \\ \cmidrule(r){1-7}
[22] & 2015 & \ding{55} & \ding{55} & \ding{51} & \ding{51} & - Demand side management &  \\ \cmidrule(r){1-7}
Our  & 2021 & \ding{51} & \ding{51} & \ding{51} & \ding{51} & - Demand side management &  \\ \bottomrule
\end{tabular}%
}
\end{table}
1
  • have a look at the answer below please if it suits the requirement
    – js bibra
    Jan 27 at 1:16
1

enter image description here

(red lines show text borders)

For vertical centering of multirow cell contents you need to estimate how many lines of text cen be spaced in its height:

9 lines in adjacent column + 10 space around table horizontal rules ~ 12 lines

\documentclass{article}
\usepackage[margin=20mm]{geometry}
\usepackage{pifont}
\usepackage{booktabs, makecell, multirow, tabularx}
\renewcommand\theadfont{\small\bfseries}
\usepackage[skip=1ex]{caption}

%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{lipsum}

\begin{document}
    \begin{table}[ht]
\caption{}
\label{tab:my-table}
    \footnotesize
    \setlength\tabcolsep{4pt}
    \centering
\begin{tabularx}{\linewidth}{@{} cc cc cc l X @{}}
\toprule
\thead{Ref.} 
    & \thead{Time} 
        & \thead{Specs\\ Sel.}  
            & \thead{Specs\\ Sel.} 
                & \thead{Specs\\ Sel.} 
                    & \thead{Specs\\ Sel.} 
                        & \thead{Specs\\ Sel.} 
                            & \thead{Specs\\ Sel.}     \\ 
    \midrule
1   & 20159 & \ding{55} & \ding{55} & \ding{51} & \ding{51} 
    & - Demand side management  &   \multirow{12}[5]{=}{%
                    blah blah blah blah blah blah blah blah
                    bbbbb bbb bbbbb bbbb bbbbbb bbbbb bbbbb 
                    bbbbb bbbbbb bbbbbb bbbb bbb bb bbb bbb  
                    bbbb bbbb bbbb bbb bb bbb bbbbb bbbb bb
                    bbbb bbbbb bbbb bbb bbb bbb bbb bbb bbb 
                    bbb bbb bb bbb}     \\
    \cmidrule(r){1-7}
2   & 2018 & \ding{55} & \ding{55} & \ding{51} & \ding{51} 
    & - Demand side management  &                   \\ 
    \cmidrule(r){1-7}
3   & 2014 & \ding{55} & \ding{55} & \ding{51} & \ding{51} 
    & - Demand side management  &                   \\ 
    \cmidrule(r){1-7}
4   & 2017 & \ding{55} & \ding{55} & \ding{51} & \ding{51} 
    & - Demand side management  &                   \\ 
    \cmidrule(r){1-7}
5   & 2017 & \ding{55} & \ding{55} & \ding{51} & \ding{51} 
    & - Demand side management  &                   \\ 
    \cmidrule(r){1-7}
6   & 2017 & \ding{55} & \ding{55} & \ding{51} & \ding{51} 
    & - Demand side management &                    \\ 
    \cmidrule(r){1-7}
7   & 2016 & \ding{55} & \ding{55} & \ding{51} & \ding{51} 
    & - Demand side management &                    \\ 
    \cmidrule(r){1-7}
[22]& 2015 & \ding{55} & \ding{55} & \ding{51} & \ding{51} 
    & - Demand side management &                    \\ 
    \cmidrule(r){1-7}
Our & 2021 & \ding{51} & \ding{51} & \ding{51} & \ding{51} 
    & - Demand side management &                    \\ 
    \bottomrule
\end{tabularx}
    \end{table}
\end{document}

Note: I took a liberty and in above MWE suggest the following:

  • for column headers use thead instruction defined in the makcell package,
  • remove use of tabular in the multirow cell and it define as \multirow{12}[5]{=}{...} where in [5] is number of text lines in multirow cells
  • since table is quite wide is beter of tabular to use tabularx table which width is prescribed to be equal text width (by \linewidth}
1

enter image description here

\documentclass[10pt,a4paper]{article}

\usepackage{ pifont, lipsum}
\usepackage{booktabs,multirow,array,caption}

\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}

\begin{document}
    \begin{table}[]
        \centering
        \caption{}
        \label{tab:my-table}
%       {\textwidth}{!}{%
            \begin{tabular}{@{}cccccccP{5cm}@{}}
                \toprule
                \textbf{Ref.} &
                \textbf{Time} &
                \multicolumn{6}{c}{\textbf {Spec Selection}} \\ \midrule
                1 &
                20159 &
                \ding{55} &
                \ding{55} &
                \ding{51} &
                \ding{51} &
                @ &
                \multirow{9}{=}{\centering \lipsum[75]} \\ \cmidrule(r){1-7}
                2    & 2018 & \ding{55} & \ding{55} & \ding{51} & \ding{51} & @ &  \\ \cmidrule(r){1-7}
                3    & 2014 & \ding{55} & \ding{55} & \ding{51} & \ding{51} & @ &  \\ \cmidrule(r){1-7}
                4    & 2017 & \ding{55} & \ding{55} & \ding{51} & \ding{51} & @ &  \\ \cmidrule(r){1-7}
                5    & 2017 & \ding{55} & \ding{55} & \ding{51} & \ding{51} & @ &  \\ \cmidrule(r){1-7}
                6    & 2017 & \ding{55} & \ding{55} & \ding{51} & \ding{51} & @ &  \\ \cmidrule(r){1-7}
                7    & 2016 & \ding{55} & \ding{55} & \ding{51} & \ding{51} & @ &  \\ \cmidrule(r){1-7}
                [22] & 2015 & \ding{55} & \ding{55} & \ding{51} & \ding{51} & @ &  \\ \cmidrule(r){1-7}
                Our  & 2021 & \ding{51} & \ding{51} & \ding{51} & \ding{51} & @ &  \\\midrule[1.5pt]
                \multicolumn{8}{l}{@=some text to define column 7}\\ \bottomrule
            \end{tabular}%
%       }
    \end{table}

\end{document}

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.