将多行单元格内容居中

将多行单元格内容居中

根据下表代码,有人可以帮我吗:

  1. 垂直和水平居中TextB1, TextAB, TextC0, TextC1,TextC2TextC17TextC18
  2. 沿包含 的单元格右侧绘制垂直线。即,沿包含... 直到 ...TextC0的单元格左侧绘制一条线。无法使用该命令执行此操作。TextC1TextC6|\multirow

如果你能帮助我的话我将非常感激。

    \begin{table}[h]
    \footnotesize
    \centering
    \renewcommand{\arraystretch}{1.5}
    \setlength{\arrayrulewidth}{1.5pt}
    \def\tabularxcolumn#1{m{#1}}
    \begin{tabularx}{\linewidth}{|>{\centering\arraybackslash}m{1.8cm} >    {\centering\arraybackslash}m{1.8cm} m{1.8cm} X >{\centering\arraybackslash}m{2.5cm}|}
    \hline
    \multicolumn{2}{|m{3.6cm}}{\centering{\textbf{Vertically and horizontally centered  Text (width = 2cm (colum1) + 2cm (column2) = 4cm)}}} & \centering{\textbf{Vertically and horizontally centered Text (width = 1.8cm)}} & \textbf{Justified and vertically centered Text (width= X)} & \textbf{Vertically and horizontally centered Text (width=2.5cm)}   \tabularnewline \hline
    \multicolumn{2}{|c}{TextA1} & TextA2 & LongText1 LongText1 LongText1 LongText1 LongText1 LongText1 & \multirow{5}{*}{TextAB}  \\ \cline{1-4}
    \multicolumn{2}{|c}{\multirow{4}{*}{TextB1}} & TextB2 & LongText2 LongText2 LongText2 LongText2 LongText2 LongText2 & \\ \cline{3-4}
    & & TextB3 & LongText3 LongText3 LongText3 LongText3 LongText3 LongText3 & \\ \cline{3-4}
    & & TextB4 & LongText4 LongText4 LongText4 LongText4 LongText4 LongText4 & \\ \cline{3-4}
    & & TextB5 & LongText5 LongText5 LongText5 LongText5 LongText5 LongText5 & \\ \hline
    \multirow{10}{*}{TextC0} & \multirow{2}{*}{TextC1} & TextC7 & LongText6 LongText6 LongText6 LongText6 LongText6 LongText6 & \multirow{2}{*}{TextC17} \\ \cline{3-4}
    & & TextC8 &  LongText7 LongText7 LongText7 LongText7 LongText7 LongText7 & \\ \cline{2-5}
    & \multirow{4}{*}{TextC2} & TextC9 & LongText8 LongText8 LongText8 LongText8 LongText8 LongText8 & \multirow{4}{*}{TextC18} \\ \cline{3-4}
    & & TextC10 & LongText9 LongText9 LongText9 LongText9 LongText9 LongText9 & \\ \cline{3-4}
    & & TextC11 & LongText10 LongText10 LongText10 LongText10 LongText10 LongText10 & \\ \cline{3-4}
    & & TextC12 & LongText11 LongText11 LongText11 LongText11 LongText11 LongText11 & \\  \cline{2-5}
    & TextC3 & TextC13 & LongText11 LongText11 LongText11 LongText11 LongText11 LongText11 & TextC19 \\ \cline{2-5}
    & TextC4 & TextC14 & LongText12 LongText12 LongText12 LongText12 LongText12 LongText12 & TextC20 \\ \cline{2-5}
    & TextC5 & TextC15 & LongText13 LongText13 LongText13 LongText13 LongText13 LongText13 & TextC21 \\ \cline{2-5}
    & TextC6 & TextC16 & LongText14 LongText14 LongText14 LongText14 LongText14 LongText14 & TextC22 \\ \hline
    \end{tabularx}
    \end{table} 

相关内容