0

I created the following table, but I wanted "Name of Author," "Year," and other relevant content to be centered vertically within the cells.

I'm using the Sage latex template: Download it here

\begin{table}[H]
\caption{previously published works on the field of sensitivity analysis of WT}\label{tab:literature1}
\centering
\renewcommand{\arraystretch}{1.3}
\resizebox{\textwidth}{!}{
\begin{tabular}{p{1.5cm}cccp{3.2cm}p{6cm}}
\toprule%
\textbf{Author}     & \textbf{Publisher} & \textbf{Year}  &  \textbf{Method} & \multicolumn{1}{c}{\textbf{WS range}} &  \multicolumn{1}{c}{\textbf{Aim and key points}} \\ 
\midrule
Kusiak      & ASME    & 2010 & GSA & In three WS categories: 3.5-7, 7-12, and 12-15 m/s & Investigated the relationship between vibrations and various wind turbine parameters \\
\midrule
McKay  & Wiley  & 2014 & GSA & Changing & Base on Extended Fourier amplitude sensitivity, and explored parameter changes in the WTs.  \\ 
\midrule
Ziegler & Elsevier   & 2015  & L/GSA & -- & Identified mean sea level (MSL) and wave peak period (Tp) as significant factors influencing fatigue loads, using both LSA and GSA.  \\
\midrule
Alavi   & Elsevier & 2016 & GSA & changing & Explored sensitivity in four wind speed models, considering the accuracy of measured wind data and evaluating goodness-of-fit with nine metrics.   \\
\midrule
Echeverría   & Wiley & 2017 & GSA & Changing 3 to 14 m/s & Used for screening to simplify complex models and provided a list of non-affecting variables. \\
\midrule
Hübler   & Elsevier & 2017 & GSA & Two wind speeds of 11 and 35 m/s &  Proposed a new four-step sensitivity analysis technique, aiming for a balance between computational efficiency and model complexity.  \\
\midrule
Robertson, Shaler   & Copernicus & 2019-21 & GSA &  &   Utilized the elementary effect method to study parameters influencing turbine loads. \\
\midrule
Carta   & Elsevier & 2020 & GSA & changing &  Investigated uncertainties in parameters and found that wind speed, active power set-point, and turbulence intensity accounted for over 98\% of the response model variation.  \\
\midrule
Moghadam   & Elsevier & 2021 & LSA & Average of 11 m/s & Utilized local sensitivity analysis based on partial derivatives to simplify and derive a closed-form expression.   \\
\midrule
Biazar   & Wiley & 2022 & GSA & In two regions of FL with a speed of 22 m/s and PL with a speed of 11 m/s &  Examined sensor bias errors on wind turbines using the Monte Carlo method in different regions. In the PL region, errors affect all sensors similarly, especially impacting power output. However, in the FL region, the generator speed sensor error has the most significant impact on WT power output.  \\
\midrule
\multicolumn{3}{c}{Current study}  & GSA & Changing continuously 5 to 20 m/s which include both PL and FL regions &   Focus on the precision of the sensors of a wind turbine in order to \\
\bottomrule
\end{tabular}
}
\end{table}

enter image description here

please help me to solve it

4
  • Unrelated, but scaling elements, which contain text, is not the best of ideas tex.stackexchange.com/questions/425453/… Commented Oct 10, 2023 at 12:30
  • Also using justified text in very narrow columns can lead to rather ugly spacing. Left aligning the text usually looks better. Looking at the siunitx package might also be a good idea to get proper spacing between numbers and units. Commented Oct 10, 2023 at 12:31
  • 2
    Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for the users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Commented Oct 10, 2023 at 12:32
  • 1
    Is it really necessary to vertically center the cells and too add those horizontal lines? With top alignment you can distinguish the rows by just adding vertical space between them.
    – egreg
    Commented Oct 11, 2023 at 9:03

2 Answers 2

2

It's very simple: just change your p placement parameters to m. To use this option, you need to load the array package.

So, your tabular begin part would be something like this:

\begin{tabular}{@{}m{1.5cm}cccm{3.2cm}m{6cm}@{}}

Your MWE is not quite clear, but I got your question based on experience.

\documentclass[10pt]{report}

% packages that the user has forgotten to mention in his question
\usepackage{anysize}
\usepackage{graphicx}
\usepackage{booktabs}

% load these two packages
\usepackage{array}
\usepackage{float}

\begin{document}
\begin{table}[H]
\caption{previously published works on the field of sensitivity analysis of WT}\label{tab:literature1}
\centering
\renewcommand{\arraystretch}{1.3}
\resizebox{\textwidth}{!}{
\begin{tabular}{@{}m{1.5cm}cccm{3.2cm}m{6cm}@{}}
\toprule%
\textbf{Author}     & \textbf{Publisher} & \textbf{Year}  &  \textbf{Method} & \multicolumn{1}{c}{\textbf{WS range}} &  \multicolumn{1}{c}{\textbf{Aim and key points}} \\ 
\midrule
Kusiak      & ASME    & 2010 & GSA & In three WS categories: 3.5-7, 7-12, and 12-15 m/s & Investigated the relationship between vibrations and various wind turbine parameters \\
\midrule
McKay  & Wiley  & 2014 & GSA & Changing & Base on Extended Fourier amplitude sensitivity, and explored parameter changes in the WTs.  \\ 
\midrule
Ziegler & Elsevier   & 2015  & L/GSA & -- & Identified mean sea level (MSL) and wave peak period (Tp) as significant factors influencing fatigue loads, using both LSA and GSA.  \\
\midrule
Alavi   & Elsevier & 2016 & GSA & changing & Explored sensitivity in four wind speed models, considering the accuracy of measured wind data and evaluating goodness-of-fit with nine metrics.   \\
\midrule
Echeverría   & Wiley & 2017 & GSA & Changing 3 to 14 m/s & Used for screening to simplify complex models and provided a list of non-affecting variables. \\
\midrule
Hübler   & Elsevier & 2017 & GSA & Two wind speeds of 11 and 35 m/s &  Proposed a new four-step sensitivity analysis technique, aiming for a balance between computational efficiency and model complexity.  \\
\midrule
Robertson, Shaler   & Copernicus & 2019-21 & GSA &  &   Utilized the elementary effect method to study parameters influencing turbine loads. \\
\midrule
Carta   & Elsevier & 2020 & GSA & changing &  Investigated uncertainties in parameters and found that wind speed, active power set-point, and turbulence intensity accounted for over 98\% of the response model variation.  \\
\midrule
Moghadam   & Elsevier & 2021 & LSA & Average of 11 m/s & Utilized local sensitivity analysis based on partial derivatives to simplify and derive a closed-form expression.   \\
\midrule
Biazar   & Wiley & 2022 & GSA & In two regions of FL with a speed of 22 m/s and PL with a speed of 11 m/s &  Examined sensor bias errors on wind turbines using the Monte Carlo method in different regions. In the PL region, errors affect all sensors similarly, especially impacting power output. However, in the FL region, the generator speed sensor error has the most significant impact on WT power output.  \\
\midrule
\multicolumn{3}{c}{Current study}  & GSA & Changing continuously 5 to 20 m/s which include both PL and FL regions &   Focus on the precision of the sensors of a wind turbine in order to \\
\bottomrule
\end{tabular}
}
\end{table}
\end{document}

output:

vertical-centered-rows

for your SAGE template just use \columnwidth instead of \textwidth inside \resizebox command. Or, you can use the stared version of table environment (\begin{table*}...\end{table*}) without the [H] option.

1
  • Scaling table size is not good idea. Using it can cause inconsistency in table font size which leads to bad typography of your document. Better is to define smaller font size used in table body (for example \small as are used in examples below).
  • Table design in provided MWE (Minimal Working Example) is much nicer than desired one. I would only remove \midrules in table body.
  • For table I would rather use tabularray package. Using it table code is shorter and simpler:
\documentclass{article}
\usepackage{geometry}   % for determining page layout, which is unknown
\usepackage[skip=1ex]{caption}
\usepackage{microtype}
\usepackage{tabularray}
\UseTblrLibrary{siunitx}
\sisetup{range-units = single,
         per-mode = symbol,
         range-phrase = - }


\begin{document}
    \begin{table}[ht]
\caption{previously published works on the field of sensitivity analysis of WT}
\label{tab:literature1}
    \small
\begin{tblr}{hline{1,Z} = 1pt, hline{2}=0.5pt, 
             colsep  = 3pt,
             colspec = {@{} Q[l, wd=16mm] ccc  
                            Q[l, wd=32mm, cmd={\linespread{0.84}\relax}] 
                            X[j, cmd={\linespread{0.84}\relax}]  @{}},
             row{1}  = {font=\bfseries}
             }
Author      & Publisher     & Year  & Method    & WS range  & Aim and key points        \\
Kusiak      & ASME          & 2010  & GSA       & In three WS categories: 3.5-7, 7-12, and \qtyrange{12}{15}{\metre\per\second} 
                                                            & Investigated the relationship between vibrations
                                                              and various wind turbine parameters \\
McKay       & Wiley         & 2014  & GSA       & Changing  & Base on Extended Fourier amplitude sensitivity, 
                                                              and explored parameter changes in the WTs.  \\
Ziegler     & Elsevier      & 2015  & L/GSA     & --        & Identified mean sea level (MSL)
                                                              and wave peak period (Tp) as significant factors influencing fatigue loads, using both LSA and GSA.  \\
Alavi       & Elsevier      & 2016  & GSA       & changing  & Explored sensitivity in four wind speed models, considering
                                                              the accuracy of measured wind data and evaluating goodness-of-fit with nine metrics.   \\
Echeverría  & Wiley         & 2017  & GSA       & Changing \qtyrange{3}{14}{\metre\per\second}
                                                            & Used for screening to simplify complex models and provided a list
                                                              of non-affecting variables. \\
Hübler      & Elsevier      & 2017  & GSA       & Two wind speeds of \qtyrange{11}{35}{\metre\per\second}
                                                            & Proposed a new four-step sensitivity analysis technique, aiming for
                                                              a balance between computational efficiency and model complexity.  \\
Robertson, Shaler
            & Copernicus    & 2019-21 & GSA     &           & Utilized the elementary effect method to study parameters
                                                              influencing turbine loads. \\
Carta       & Elsevier      & 2020      & GSA   & changing  & Investigated uncertainties in parameters and found that wind speed,
                                                              active power set-point, and turbulence intensity accounted for over \qty{98}{\percent} of the response model variation.  \\
Moghadam   & Elsevier       & 2021      & LSA   & Average of 11 m/s
                                                            & Utilized local sensitivity analysis based on partial derivatives to
                                                              simplify and derive a closed-form expression.   \\
Biazar      & Wiley         & 2022      & GSA   & In two regions of FL with a speed of \qty{22}{\metre\per\second} 
                                                  and PL with a speed of \qty{11}{\metre\per\second}
                                                            & Examined sensor bias errors on wind turbines using the Monte Carlo method in different regions. In the PL region, errors affect all sensors similarly, especially impacting power output. However, in the FL region, the generator speed sensor error has the most significant impact on WT power output.  \\
\SetCell[c=3]{l}   Current study
            &               &           & GSA   & Changing continuously \qtyrange{5}{20}{\metre\per\second} which include both PL
                                                  and FL regions
                                                            & Focus on the precision of the sensors of a wind turbine in order to \\
\end{tblr}
    \end{table}
\end{document}

enter image description here

However, if you persist to have vertical centered cells' contents, than you in above MWE only need to change table preamble to:

\begin{tblr}{hline{1,Z} = 1pt, hline{2}=0.5pt, hline{3-Y} = {solid},
             colsep  = 3pt,
             colspec = {@{} Q[l, m, wd=16mm] ccc  
                            Q[l, m, wd=32mm, cmd={\linespread{0.84}\relax}] 
                            X[j, m, cmd={\linespread{0.84}\relax}]  @{}},
             row{1}  = {font=\bfseries}
             }

Result is than (to my opinion not so nice):

enter image description here

You must log in to answer this question.

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