3

I want to make a cell overflow to the left.

In this Question: Allowing cell to overflow without affecting indentation
we learn how to make an overflow to the right(row 1), but I cannot manage to make the box expand to the left.

\begin{table}[H]
  \begin{tabular}{p{1.2cm}p{2.8cm}l}
    Col1 & Col2 & Col3  \\ 
    \cmidrule( r){1-1} \cmidrule(lr){2-2} \cmidrule(lr){3-3} 
    \makebox[0pt][l]{impressively long}  &       & short            \\
    short                                &       & impressively long}  \\
    short                                & foo   & impressively long}  \\
  \end{tabular}
\end{table}

enter image description here

How can I make the cells in row 2 and 3 of the last column make use of the second column. I prefer a solution with boxes as in the aforementioned post, but any simple solution will do.

2
  • 1
    \hfill\makebox[0pt][r]{impressively long} Mar 30, 2015 at 11:36
  • I would take @UlrikeFischer's advice while at the same time making the alignment of tabular column 3 r. On the other hand, if the alignment of col3 must remain l, then maybe change the 0pt of her advice to some finite length, like 5ex. Mar 30, 2015 at 11:50

1 Answer 1

1

My best shot at the time is to use \multicolumn and \hfill

\begin{table}[H]
  \begin{tabular}{p{1.2cm}p{2.8cm}l}
    Col1 & Col2 & Col3  \\ 
    \cmidrule( r){1-1} \cmidrule(lr){2-2} \cmidrule(lr){3-3} 
    \makebox[0pt][l]{impressively long}  &       & short            \\
    short                                & \multicolumn{2}{r}{           impressively long}  \\
    short                                & \multicolumn{2}{l}{foo \hfill impressively long}  \\
  \end{tabular}
\end{table}

enter image description here

1
  • I'd use \multicolumn{2}{l} for the top left entry.
    – egreg
    Mar 30, 2015 at 11:44

You must log in to answer this question.

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