0

I have the following table. It contains multi-column headings.

I want the multi-column headings to be equally distributed in the available space. There is asymmetry now. The first two headings are too close and there is a space then the third one.

How can I adjust them to make equal width of the columns?

\documentclass{article}

\newcommand*{\zerobox}[2][l]{%
\raisebox{0pt}[0pt][0pt]{\makebox[0pt][#1]{#2}}
}
\newcommand*{\anglelabel}[1]{%
\multicolumn{1}{c}{\rotatebox{45}{\zerobox{#1}}}%
}
\newcommand*{\rotLabel}[1]{%
\anglelabel{\zerobox{#1}}
}

\usepackage{tikz}
\usepackage{mathtools}
\newcommand{\filledcirc}{${\color{black}\bullet}\mathllap{\circ}$}
\newcommand{\normalcirc}{${\color{white}\bullet}\mathllap{\circ}$}
\begin{document}


\begin{tabular}{ccc}
 \rotLabel{Xxxxxxx}
& \rotLabel{Ccccccccccccc}
& \rotLabel{Rrrrrrrr Rrrrr} 

\\
\hline
\multicolumn{3}{|c|}{\textit{Ddddddddd Dddd}}\\
\hline
\end{tabular}

\end{document}

enter image description here

CarLaTeX
  • 62,716
user6875880
  • 2,183

1 Answers1

0

Code taken from this answer:

\documentclass{article}

\usepackage{adjustbox}
\usepackage{array}

\newcolumntype{R}[2]{%
    >{\adjustbox{angle=#1,lap=\width-(#2)}\bgroup}%
    l%
    <{\egroup}%
}
\newcommand*\rot{\multicolumn{1}{R{45}{1.4em}}}% I've changed only 1.4 instead of 1

\begin{document}
    \begin{tabular}{ccc}
        \rot{Xxxxxxx} & \rot{Ccccccccccccc} & \rot{Rrrrrrrr Rrrrr}\\
        \hline
        \multicolumn{3}{|c|}{\textit{Ddddddddd Dddd}}\\
        \hline
    \end{tabular}
\end{document}

enter image description here

CarLaTeX
  • 62,716