0

I have a table, say

\begin{tabular}{|p{1cm}|p{10cm}|}
  \hline
  t ... b & text with some number of lines 
\\
  \hline
\end{tabular}

In the right (large) entry I have text with some (but originally indefinite) number of lines (some quote, say). In the left entry I want to see 't' in the top of entry, and 'b' in the bottom, respectively.

So I'd like to organize some analog of \vspace*{\fill} (which moves text for common page), but for the single tabular entry, whose height is unknown and determined by the text of the neighbour entry.

\vspace*{\fill} being put between 't' and 'b', does not affect since (my assumption) LaTeX is not in vertical mode.

Could anybody help with advise or refer to some tex.stackexchange page where such a question was discussed?

1
  • 1
    Can you please add a minimal but working example (MWE) instead of a code snippet next time? Otherwise every helper has to construct one before testing his/her suggestion. So a MWE would help us to help you. Jul 26, 2017 at 16:40

2 Answers 2

1

You could use overprinting:

\documentclass{article}
\usepackage{mwe}
\begin{document}
\begin{tabular}{|p{1cm}|p{10cm}|}
  \hline
  t & \blindtext\\[-\normalbaselineskip]% jump back one text line
  \hfill\dots\ b & \\ % and overprint the last line
  \hline
\end{tabular}
\end{document}

enter image description here

Note: This solution fails, if the last line in the right column does not have the height of a normal text line.

0

Some parameters are hardwired, but better than nothing. The idea is to measure the height of the right column.

\documentclass{article}
\usepackage{array}

\usepackage{lipsum} % just for the example

\newcommand{\funnyrow}[3]{%
  % #1 = text at the top in the left column
  % #2 = text at the bottom in the left column
  % #3 = text in the right column
  \sbox0{\parbox[b]{10cm}{#3}}%
  \parbox[b][\ht0][s]{1cm}{#1\vfill\raggedleft#2}&
  #3
}

\begin{document}

\begin{center}
\begin{tabular}{|b{1cm}|b{10cm}|}
\hline
\funnyrow{t}{\dots b}{
  \lipsum*[2]
}\\
\hline
\end{tabular}
\end{center}

\end{document}

enter image description here

You must log in to answer this question.

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