title: How to center text vertically in table cell in LaTex tabular environment?
body: <p>I would like to center the text in each cell horizontally and vertically. With the code below, the text is centered horizontally but not vertically and appears at the top of the cells. Thanks in advance!</p>
  <pre><code>\documentclass[jou]{apa7}
  \usepackage{tabularx,colortbl}
  
  \begin{document}
  \newcolumntype{L}[1]{&gt;{\raggedright\arraybackslash}p{#1}}
  \newcolumntype{C}[1]{&gt;{\centering\arraybackslash}p{#1}}
  \newcolumntype{R}[1]{&gt;{\raggedleft\arraybackslash}p{#1}}
  
  \begin{tabular}{| L{1cm} | C{5cm} | C{5cm} | C{5cm} |} \hline
  \rowcolor[gray]{.4}&amp; \color{white}Cell 1 &amp; \color{white}Cell 2 &amp; \color{white}Cell 3 \\[30pt] \hline
  \cellcolor[gray]{.4}\color{white}Cell 4 &amp; Cell 5 &amp; Cell 6 &amp; Cell 7 \\[100pt] \hline
  
  
  \end{tabular}
  
  \end{document}
  </code></pre>
  <p><a href="https://i.stack.imgur.com/7NjCT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7NjCT.png" alt="enter image description here" /></a></p>