5

After running following code

\documentclass[10pt]{article}
\usepackage{multirow}

\begin{document}

\begin{tabular}{|l|l|l|} \hline
\multicolumn{3}{|c|}{Schedulers} \\ \hline
\multirow{3}{3cm}{Row 1. long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text } & RR & Round Robin \\
& EF & Earliest First \\
& LL & Lightest Loaded \\ \hline

\multirow{4}{*}{Row 2.} & MM & Min-Min \\ 
& MX & Max-Min \\
& DL & Dynamic Level \\ 
& RC & Relative Cost \\ \hline

\multirow{4}{*}{Row 3.} & PN & This paper \\
& ZO & Genetic Algorithm\\
& TA & Tabu search\\
& SA & Simlulated Annealing \\ \hline
\end{tabular}

\end{document}

I get this output:

enter image description here

What should I do to make first three rows (RR, EF and LL) accordingly higher?

1 Answer 1

5

Unfortunately multirow doesn't expand rows if it is bigger than the rows it is spanning. In this case changing \\ to \\[1cm] make a reasonable result. A more automatic solution is possible but harder.

enter image description here

\documentclass[10pt]{article}
\usepackage{multirow}

\begin{document}

\begin{tabular}{|l|l|l|} \hline
\multicolumn{3}{|c|}{Schedulers} \\ \hline
\multirow{3}{3cm}{Row 1. long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text long text } & RR & Round Robin \\[1cm]
& EF & Earliest First \\[1cm]
& LL & Lightest Loaded \\[1cm] \hline

\multirow{4}{*}{Row 2.} & MM & Min-Min \\ 
& MX & Max-Min \\
& DL & Dynamic Level \\ 
& RC & Relative Cost \\ \hline

\multirow{4}{*}{Row 3.} & PN & This paper \\
& ZO & Genetic Algorithm\\
& TA & Tabu search\\
& SA & Simlulated Annealing \\ \hline
\end{tabular}

\end{document}
2
  • 3
    I'll be glad to know this auto solution. I need it, cause this table is only an example. I'm searching for solution that will work with variable amount of rows.
    – user26173
    Feb 19, 2013 at 17:42
  • ...and with variable text in left cell
    – user26173
    Feb 19, 2013 at 17:49

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.