4

I have 2 tables side by side. Table 1 is dynamic and while table 2 is static (fixed content). I need to adjust the row height of table 2 which must be equal to total height of table 1 (like multirow) but I don't want to use multirow.

 \documentclass{article}
 \usepackage{subcaption}
 \begin{document}
 \begin{minipage}{0.8\linewidth}

   \begin{tabular}{ | p{5cm} | p{1cm} | p{2.5cm} | }
   \hline
     A clear day with lots of sunshine.However, the strong breeze will bring down the temperatures & 2 & 3 \\[2cm]
    \hline
   A clear day with lots of sunshine. However, the strong breeze will bring down the temperatures & 5 & 6 \\[2cm]
   \hline
   A clear day with lots of sunshine. However, the strong breeze will bring down the temperatures & 8 & 9 \\[1cm]
   \hline
  \end{tabular}

 \end{minipage}
 \begin{minipage}{0.2\linewidth}


 \begin{tabular}{ |p{5cm}| }
 \hline
  For columns that will contain text whose length exceeds the column's  width, it is recommended that you use the p attribute and specify the desired  width of the column (although it may take some trial-and-error to get the result  you want). \\[5cm]
 \hline
 \end{tabular}
 \end{minipage}
 \end{document}

enter image description here

How can I implement this?

5
  • 2
    Any reason why you don't want to use \multirow?
    – Xavier
    Sep 9, 2013 at 7:27
  • I had lot of issues while using multirow specially formatting and coloring.
    – manish
    Sep 9, 2013 at 7:44
  • Related question. tex.stackexchange.com/questions/130907/…. In that answer, \vphantoms of the one table's row were inserted into the other table, and vice-versa. Sep 9, 2013 at 10:22
  • @manish Just my personal opinion, but for what it looks you're trying to achieve, solving the few issues you might have with \multirow seem easier than trying to do without it...
    – Xavier
    Sep 9, 2013 at 14:12
  • @Xavier I am using multirow currently but row is dynamic and it is colored too. So i use /srr and use negative value of multirow but i need to add points to adjust the text in multibox. That is not good for dynamic table. tex.stackexchange.com/questions/129518/…
    – manish
    Sep 10, 2013 at 2:46

1 Answer 1

1

To avoid \multirow you could simply use a tabular within another tabular.

I have also shortened the column widths to avoid overfull \hbox.

 \documentclass{article}
 \usepackage{array}
 \renewcommand{\arraystretch}{1.2}
 \usepackage{subcaption}

 \begin{document}
 \begin{table}\centering
 \begin{tabular}{|@{}c@{}|m{4cm}|}
    \hline
    \begin{tabular}{p{4cm} | p{1cm} | p{1.3cm}}
        A clear day with lots of sunshine. However, the strong breeze will bring down the temperatures & 2 & 3 \\
        \hline
        A clear day with lots of sunshine. However, the strong breeze will bring down the temperatures & 5 & 6 \\
        \hline
        A clear day with lots of sunshine. However, the strong breeze will bring down the temperatures & 8 & 9 \\
    \end{tabular}
    & 
    For columns that will contain text whose length exceeds the column's  width, it is recommended that you use the p attribute and specify the desired  width of the column (although it may take some trial-and-error to get the result  you want). \\
    \hline
\end{tabular}
\end{table}
\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 .