I'm trying to design a layout that has tables nested within tables, and I'm having trouble getting things to line up. The question is quite similar to How to make width of an inner table use full column width of an outer table? except that I have no tabularx involved---I am looking to get the table itself to stretch. I imagine that a solution will have two components:

  • Some stretchiness to \tabcolsep
  • Some way of telling the outer table not to fill on the left and right sides

I have not been able to figure out how to achieve such an effect.

Here is a minimal working example:

  A relatively wide line& Thin \\
The ABCD table should stretch to fit&Thickest\\

The resulting table looks like

MWE output

but what I want is for the ABCD table to stretch the full width of its column (even though that would look awful in this case).

What I am actually trying to accomplish can be illustrated by considering the misalignments in the following non-minimal example:

the actual problem I am trying to solve

Two of the outcomes I would like are

  • Section E stretches automatically to become the same width as section D
  • Section G stretches automatically to become the same width as what's above it

Does anyone have ideas about how this might be accomplished?


If you want stretching, you can't use a tabular.


\settowidth{\columnA}{The ABCD table should stretch to fit}

A relatively wide line\\
A \hfil B\\
C \hfil D\\
The ABCD table should stretch to fit}%
\parbox[t][\dimexpr \ht\tempbox + \dp\tempbox][s]{\columnB}{\centering


table from scratch

  • Too depressing. There must be a way to do it. \settowidth is not a bad trick, though. – Norman Ramsey May 31 '15 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.