[Tex/LaTex] How to center vertically content of the table

tablesvertical alignment

I have this table:

\usepackage{array}
\newcolumntype{x}[1]{>{\centering\arraybackslash\hspace{0pt}}p{#1}}

\begin{table}[ht]\footnotesize
\centering
\begin{tabular*}{0.95\textwidth }{@{\extracolsep{\fill}}|llllllllllllllll|x{0.15\textwidth}|}
\hline
\multicolumn{16}{|c|}{Small text} & Long text \\ \hline 
1 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 16 & 19 & 20 & 21 & 22 & 23 & 0.9636149 \\ \hline 
\end{tabular*}
\caption{Caption}
\label{tab:Example}
\end{table}

How to center "Small text"?

Best Answer

Change the p to m in your definition of the x column type:

\newcolumntype{x}[1]{>{\centering\arraybackslash\hspace{0pt}}m{#1}}

Full example:

\documentclass{article}
\usepackage{array}
\newcolumntype{x}[1]{>{\centering\arraybackslash\hspace{0pt}}m{#1}}
\begin{document}

\begin{table}[ht]\footnotesize
\centering
\begin{tabular*}{0.95\textwidth }{@{\extracolsep{\fill}}|llllllllllllllll|x{0.15\textwidth}|}
\hline
\multicolumn{16}{|c|}{Small text} & Long long long long long text \\ \hline 
1 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 16 & 19 & 20 & 21 & 22 & 23 & 0.9636149 \\ \hline 
\end{tabular*}
\caption{Caption}
\label{tab:Example}
\end{table}
\end{document}
Related Question