3

According to the table code below, Could anyone please help me to:

  1. center vertically and horizontally TextB1, TextAB, TextC0, TextC1, TextC2, TextC17 and TextC18
  2. Draw vertical line along the right side of the cell containg TextC0. i.e. drawing a line along the left side of the cells containing TextC1 ...until... TextC6. The | can't do this with the \multirow command.

I'll really be grateful if you help me on that.

    \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} 
8
  • No1 is all-right, they're centered, what is the problem with it?
    – masu
    Commented Nov 25, 2013 at 15:29
  • 1
    I want them to be centered vertically and horizontally in the multirow
    – Houssem
    Commented Nov 25, 2013 at 15:33
  • 1
    "More" centered than this (screenshot)?! They are centered.
    – masu
    Commented Nov 25, 2013 at 15:46
  • Oh you haven't changed anything ? The result in my compil is quite different. Could you please take a look on the result of my compil here : filedropper.com/tabularx ? Thanks
    – Houssem
    Commented Nov 25, 2013 at 16:13
  • 1
    @user40953 you don't need to include urls, just edit the question so your example starts with \documentclass and ends with \end{document} and generates a table that shows the problem. Just a fragment starting \begin{table} makes it very hard for anyone to help you. Commented Nov 25, 2013 at 17:23

0

Browse other questions tagged .