0

I would like to vertical align the text 'Muscular system', which is highlighted in color lavender. I defined a new column type and the correlated questions on this website couldn't help. Thank you in advance!

    \documentclass{book}
    \usepackage{dcolumn}
    \usepackage{tabularx} 
    \usepackage{color, colortbl}
    \definecolor{LavenderBlue}{rgb}{0.85,0.85,1}

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

    \begin{document}

    \begin{table}[!h]
    \renewcommand\arraystretch{1.1}
        \centering
         \small
                \begin{tabular}{|P{4cm}|P{7cm}|}
        \hline 
    System & Effects \\
    \hline
        Circulatory system & Pericarditis, heart failure, hypertension \\ \hline
Blood tissue & Anemia \\ \hline
Gastrointestinal system & Nausea, loss of appetite, diarrhoea, stomatitis \\ \hline
Nervous system  & Somnolence, apathy, amnesia \\ \hline
\rowcolor{LavenderBlue}
Muscular system & Cramps, alteration of sensitivity, alteration of neuromuscular excitability \\ \hline
Skeletal system & Changes in bone metabolism, joint inflammation \\ \hline
Integumentary system & Pallor, itching, yellowish colour \\ \hline  
\end{tabular}
\caption{Effects caused by renal dysfunctions on the systems of the human body.}
\label{effectbody}
 \end{table}

   \end{document}
  • 1
    you want to align where? top, bottom, center? – Michael Palmer Nov 16 '17 at 14:19
  • center, please. But >{\centering\arraybackslash} didn't work for me – silvia26 Nov 16 '17 at 14:21
1

Replacing \newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}} by \newcolumntype{P}[1]{>{\centering\arraybackslash}m{#1}} in your MWE gives you the following result: enter image description here

In general, p cells are top aligned, m cells are vertically centered and b cells align their contents to the bottom of the cell.

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.