0

I'm trying to put together a three column table (in tabularx) that have the following layout (in full line width):

Section  Description           Page
    1-5  text text text ......    7
   5-12  text text text text
         text ................  121

Note:

  • Left column is to be top right align
  • Middle column spans one/multiple lines and ends with a \dotfill
  • Right column is to be bottom-right align

PS: This worked for the middle + right columns, but when I added the left most column, I can't get the text to aligned at the top.

Any suggestions on how to make this work?

(Compiling wit LuaTex in document class memoir)

1

Building upon the solution in Tabular - 3 columns with top-align and bottom-align I came up with the following:

enter image description here

\documentclass[]{article}
\usepackage{array}
\usepackage{booktabs}
\usepackage{tabularx}


\begin{document}


\noindent
    \begin{tabularx}{\textwidth}{rXr}
Section & Description & Page\\ \addlinespace
        1-5 & 
        test text text  text  text  text  text  text  text  text  text
  text  text  text  text  text  text  text  text\dotfill
        &\\[-\normalbaselineskip]&
        &7\\ \addlinespace
        5-12 & 
        test text text  text  text  text  text  text   \dotfill 
        &\\[-\normalbaselineskip]&
        &121\\
    \end{tabularx}

\end{document}
  • Yes, awesome, thanks – imdk4242 Jul 15 at 6:46
1

like this?

enter image description here

With use of the multirow package, where you need manually set the number of lines in the second column:

\documentclass{memoir}
\usepackage{multirow, tabularx}

\begin{document}
\noindent
\begin{tabularx}{\linewidth}{ r X r }
1-5     &   test text text text text text text text text text text text text text text text text text text\dotfill
            &   \multirow[b]{2}{*}{1-2}  \\
5-12    &   test text text text text text text text text text text test text text text text text text text text text text text text text text text text text text\dotfill
            &   \multirow[b]{3}{*}{34-143}
\end{tabularx}
\end{document}
  • Correct. However, I need to change the index manually each time (in above MWE: 2 for first row and 3 for second row) as I go along? This can show to be problematic if the paper size is changed etc. Is there a way of getting the same result with the right most column aligning bottom without manually inputing for each row? – imdk4242 Jul 14 at 23:16

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.