使用 tabularx 和 X 时,如何使文本垂直居中?

使用 tabularx 和 X 时,如何使文本垂直居中?
\documentclass[a4paper]{article}
\usepackage[landscape,hmargin=2cm,top=1.5cm,bottom=1.6cm,headsep=1mm,headheight=3cm]  {geometry} 
\usepackage{multirow}
\usepackage{tabularx}
\usepackage{microtype}
\usepackage{siunitx}

\begin{document}
\noindent
\begin{tabularx}{\textwidth}{|*{7}{c|}X|*{5}{c|}p{35mm}|}
    \hline
    &&&&suface quality&&&The financials crashed and burned during the 2008 meltdown but have since been in recovery mode with the rest of the market. This article will explore the risks and rewards associated with these Financial ETFs to identify which have been the best performers.&check&\SI{100}{\percent}&continueous&&worker& The Best Financial ETFs \\
    \hline
\end{tabularx}  
\end{document}

在此处输入图片描述 如上代码所示,文本无法垂直居中,如何改善?

答案1

将其添加到您的序言中,使文本与X列垂直居中

\renewcommand{\tabularxcolumn}[1]{m{#1}}

代码:

\documentclass[a4paper]{article}
\usepackage[landscape,hmargin=2cm,top=1.5cm,bottom=1.6cm,headsep=1mm,headheight=3cm]  {geometry}
\usepackage{multirow}
\usepackage{tabularx}
\usepackage{microtype}
\usepackage{siunitx}

\renewcommand{\tabularxcolumn}[1]{m{#1}}

\begin{document}
\noindent
\begin{tabularx}{\textwidth}{|*{7}{c|}X|*{5}{c|}p{35mm}|}
    \hline
    &&&&suface quality&&&The financials crashed and burned during the 2008 meltdown but have since been in recovery mode with the rest of the market. This article will explore the risks and rewards associated with these Financial ETFs to identify which have been the best performers.&check&\SI{100}{\percent}&continueous&&worker& The Best Financial ETFs \\
    \hline
\end{tabularx}
\end{document}

在此处输入图片描述

相关内容