4

I nested a table inside of my table like this:

\begin{tabular}{p{1in}||p{5in}}
    \hline
    This should be on top. & \begin{tabular}{@{\extracolsep{\fill}}lr}
                    Thing1 & Thing2 \\
                    Thing3 & Thing4 \\
                    Thing5 & Thing6 \\
                    Thing7 & Thing8 \\
                 \end{tabular} \\
    \hline
\end{tabular}

and it looks like this:

http://i.imgur.com/Pf1Ihn7.png

but since This should be on top is in a p cell, shouldn't it stay up on top? How can it be made to look like this? :

enter image description here

  • 1
    Why don't you put that cell in a minipage with the [t] placement option? – YuppieNetworking Aug 23 '13 at 14:44
  • 2
    The posted answer gives the answer, to see why: the two cells are p columns so align on the baseline of their top row. In the first cell their are two boxes from the linebroken paragraph so the baseline of the first is taken, the second cell just has a single line paragraph consisting of the nested table so the beaseline of the table is taken, which is its centre as [c] is default, so the top line of the left aligns with the centre of the table. If you use [t] the baseline of the table is that of its top row. – David Carlisle Aug 23 '13 at 15:28
  • @YuppieNetworking a minipage[t] would not change anything (that is essentially the same as a tabular p column that is already being used). – David Carlisle Aug 23 '13 at 15:29
  • @DavidCarlisle, ok thank you for the clarification, I knew that the p resulted in a minipage but I wasn't sure if it was already with the [t] placement. – YuppieNetworking Aug 23 '13 at 15:53
5

Try

\begin{tabular}{p{1in}||p{5in}}
\hline
This should be on top. & \begin{tabular}[t]{@{\extracolsep{\fill}}lr}
                Thing1 & Thing2 \\
                Thing3 & Thing4 \\
                Thing5 & Thing6 \\
                    Thing7 & Thing8 \\
             \end{tabular} \\
    \hline
\end{tabular}

Note the extra [t] in there.

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.