2

I found this answer but it wasn't exact to my needs.

I have a table which contains two columns. Each column is a list of things, one list has 16 items, the other 24 items. How do I get it so the column with 16 items is spaced so it fills the same height as the column with 24 items and has line spacing to do this?

enter image description here

1
  • What you try so far? Please provide small complete document, which we can compile, which will show your problem (spreading text in table to the same height?). – Zarko Aug 25 '16 at 13:22
3
\documentclass{article}
    \usepackage{multirow, array}
\begin{document}
    \begin{table}[h]
        \centering
        \begin{tabular}{|>{\centering}p{3.5cm}|p{3.5cm} <{\centering} |}
            \hline
            1 & \multirow{3}{*}{2} \\ 1 & \\ 1 & \\
            1 & \multirow{3}{*}{2} \\ 1 & \\ 1 &  \\
            \hline
        \end{tabular}
    \end{table}
\end{document}

enter image description here

6
  • @samcarter, where do my sentences go? Within the curly brackets of \multirow{3}{*}{2}? – Dhruv Ghulati Aug 25 '16 at 13:45
  • @DhruvGhulati Ask @ biajia, I have nothing to do with this answer, I only fixed the markup of the code. But I guess you should replace the 1's and 2's with text. – samcarter_is_at_topanswers.xyz Aug 25 '16 at 13:51
  • I see no 2s, I get there are 6 1s though..@biajia? – Dhruv Ghulati Aug 25 '16 at 13:57
  • @DhruvGhulati, I ran it well in my computer, maybe you missed some packages. – biajia Aug 26 '16 at 8:38
  • @biajia the question is more how do I replace the 1s and 2s with my own data? – Dhruv Ghulati Sep 1 '16 at 8:40
2

If you are looking for two independent columns a table might not be the ideal thing to use. How about placing your text in minipages? You just have to make sure that the height (.15\textheight in the example) is sufficient for the columns with the most lines.

\documentclass{article}
\usepackage{multirow, array}

\begin{document}
    \begin{minipage}[t][.15\textheight]{.4\textwidth}
        first line

        \vfill

        second line

        \vfill

        first line

        \vfill

        second line
    \end{minipage}
    \begin{minipage}[t][.15\textheight]{.4\textwidth}
        first line

        \vfill

        second line

        \vfill

        first line

        \vfill

        second line

        \vfill

        second line

        \vfill

        first line

        \vfill

        second line
    \end{minipage}  
\end{document}

enter image description here

2

You can set the height of a cell using the \parbox. Then putting two columns next to each other with the same total height should do it. Something like this:

\documentclass{article}
\usepackage{calc}
\begin{document}

\newlength\TableHeight
\setlength\TableHeight{5\baselineskip}
\begin{tabular}{|c|c|}
  \hline
  \begin{tabular}{@{}c@{}}
    \parbox[b][\TableHeight/3][c]{1cm}{A}\\
    \parbox[b][\TableHeight/3][c]{1cm}{A}\\
    \parbox[b][\TableHeight/3][c]{1cm}{A}
  \end{tabular}
  &
  \begin{tabular}{@{}c@{}}
    \parbox[b][\TableHeight/5][c]{1cm}{B}\\
    \parbox[b][\TableHeight/5][c]{1cm}{B}\\
    \parbox[b][\TableHeight/5][c]{1cm}{B}\\
    \parbox[b][\TableHeight/5][c]{1cm}{B}\\
    \parbox[b][\TableHeight/5][c]{1cm}{B}
  \end{tabular}
  \\\hline
\end{tabular}

\end{document}

enter image description here

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.