I think I am using the wrong search queries to say this, but I'm trying to make a table that contains cells whose widths are determined by their parents' uniformity, not whose parents' widths are determined by their childrens' uniformity.

My example is I'd like to make my table look like this:

enter image description here

As you can see, the titlebars for col1 == col2 == col3 in width.

Child cells x1 == x2 == x3, and y1 == z1, but x1 != y1.

However, the code I have below is producing even child cells, and differently sized parent cells:

\begin{tabu} to \textwidth { | *{5}{X[c]|} | *{3}{X[c]|} | *{3}{X[c]|} }
    \multicolumn{5}{c}{col1} & \multicolumn{3}{c}{col2} & \multicolumn{3}{c}{col3} \\
    %% \cmidrule{1-5} \cmidrule{6-8} \cmidrule{9-11} \\
    x1 & x2 & x3 & x4 & x5 & y1 & y2 & y3 & z1 & z2 & z3 \\
    1 & 1 & 1 & 1 & 1 & 2 & 2 & 2 & 3 & 3 & 3 \\


As you can see:

It looks like this

What should I do differently?

  • Is it essential for the cell entries in row 3 to be right-aligned? Or should the be either left-aligned or centered? Please advise.
    – Mico
    Commented Nov 7, 2018 at 6:38
  • Not essential for any rows after the header. If following rows are flexible, that's even better, honestly, like if y1{r},y2{c},y3{l}, equation-style with an equals sign in y2{c}'s cell, that would be ideal. All of x I would like center-aligned though. Commented Nov 7, 2018 at 6:48
  • So should there be any vertical bars in the interiors of the Y and Z groups of columns? For that matter, should there be any vertical bars at all? (Your use of \cmidrule directives seems to indicate that there should be no vertical bars to begin with.) Please clarify.
    – Mico
    Commented Nov 7, 2018 at 7:12

1 Answer 1


I think you can achieve your formatting objective by switching to a tabularx environment and using the environment's ability to specify relative column widths.

If the first main column has 5 equal-width sub-columns, and if the second and third main columns have (essentially) no sub-columns, the relative width of each of the first 5 subcolumns is given by 7/15=0.4667. Why 7 and 15? Because (a) there are effectively 7 columns and (b) one can think of the entire tabular-like environment taking up 5*3=15 columns. The relative widths of the second and third main columns are given by 5*0.46667=2.3333. Note that 5*0.4667+2*2.3333=7, the number of columns of type X. (Aside: The math is much simplified by the fact that you're executing \setlength\tabcolsep{0pt}!)

I'm assuming that there are, effectively, no subcolumns for columns 2 and 3. I'm making this assumption because you've indicated that you plan to show equations in these two columns. I believe it's better to center the entire equation within the column, rather than simply center the = symbols.

enter image description here

\usepackage[margin=1in,letterpaper]{geometry} % set suitable page parameters
% define a flexible-width centered version of "X" column type:
% Total number of C-type columns: 7
% Number of (implicit) columns of equal width = 3*5 = 15
% Relative width of 5 subcolumns of col. 1: 7/15=0.4667
% Note: 5*0.4667+2*2.3333 = 7 = # of C-type columns 
\begin{tabularx}{\textwidth}{ *{5}{C{0.4667}} *{2}{C{2.3333}} }
\multicolumn{5}{@{}c}{header 1} & header 2 & header 3 \\
x1 & x2 & x3 & x4 & x5 \\
1 & 2 & 3 & 4 & 5 & yyyyy & zzzzz \\
a & b & c & d & e &
$\displaystyle v=\int_{-\infty}^{\infty} e^{-x^2}dx$ & 
$\displaystyle w=\sum_{i=1}^{\infty}\frac{1}{i^2}$ \\

  • Thank you, @Mico, this is very helpful. It looks like I do need to make the 2 parent columns on right be split into 3s, I have equal signs that need to line up in cells below, where the left and rights are uneven otherwise. I think I understand the modifications I need now. Commented Nov 8, 2018 at 17:25
  • 1
    (I can also raise that as a different question.) Commented Nov 8, 2018 at 20:26

You must log in to answer this question.

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