1

I'm struggling trying to vertically align my header rows, can anyone point out what I'm doing wrong?

 \documentclass{article}

  \usepackage{tikz}
  \usepackage{tabu}
  \usepackage{multirow}

  \usepackage[T1]{fontenc}
  \usepackage{droidserif}
  \usepackage{sourcesanspro}

  \begin{document}


  \centering      \begin{tabu}{ | X[3,m] *4{|X[1,m]} | }
              \hline
              \rowfont{\fontfamily{fdr}\fontseries{b}\selectfont}
              & \multicolumn{4}{c|}{Multi Column Header} \\ \cline{2-5}
              \rowfont{\fontfamily{fdr}\fontseries{b}\selectfont}
              & \multicolumn{4}{c|}{\small headers not vertically aligned } \\ \cline{2-5}
              \rowfont[c]{\fontfamily{fdr}\fontseries{b}\selectfont}
              \multirow{-3}{*}{Multi-Row} & \small 1-25 & \small 26-100 & \small 101-500 & 501 \\

              \hline
              \rowfont{\fontfamily{fdm}\selectfont\small}
              Something here &
                  \multicolumn{1}{r|}{11111} &
                  \multicolumn{1}{r|}{22222} &
                  \multicolumn{1}{r|}{22222} &
                  \multicolumn{1}{r|}{22222} \\

              \hline
          \end{tabu}

  \end{document}

text not aligned

1 Answer 1

1

I got rid of the extra separators, defined some custom-named column with the array package, used tabular instead of tabu and booktabs for fancy rules. I think this is kind of what you wanted

 \documentclass{article}

  \usepackage{tikz}
  \usepackage{array,booktabs,multirow}
\newcolumntype{C}{>{\fontfamily{fdr}\fontseries{b}\selectfont}c}
\newcolumntype{T}{>{\fontfamily{fdm}\selectfont\small}c}
\newcolumntype{P}{>{\fontfamily{fdm}\selectfont\small}p{3cm}}
  \usepackage[T1]{fontenc}
  \usepackage{droidserif}
  \usepackage{sourcesanspro}

  \begin{document}

\begin{table}
\centering
\begin{tabular} {PTTTT}
\toprule
\multirow{3}{*}{\fontfamily{fdr}\fontseries{b}\selectfont Multi-Row}&\multicolumn{4}{C}{Multi Column Header}\\
&\multicolumn{4}{C}{\small headers not vertically centered}\\
&\multicolumn{1}{C}{1--25}&\multicolumn{1}{C}{26--100}&\multicolumn{1}{C}{101--500}&\multicolumn{1}{C}{501}\\
\midrule
Something here & 11111&22222&22222&22222\\
\bottomrule
\end{tabular}
          \end{table}

  \end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .