The easiest way to do multirow and multicolumn spanning in latex is to use the package multirow. Just put
\usepackage{multirow} at the top of your latex file.
Above is a simple example of this in action.
\begin{tabular}{|l|l|l|} \hline
\multicolumn{3}{|c|}{Schedulers} \\ \hline
\multirow{3}{*}{Immediate} & RR & Round Robin \\
& EF & Earliest First \\
& LL & Lightest Loaded \\ \hline
\multirow{4}{*}{Batch} & MM & Min-Min \\
& MX & Max-Min \\
& DL & Dynamic Level \\
& RC & Relative Cost \\ \hline
\multirow{4}{*}{Evolutionary} & PN & This paper \\
& ZO & Genetic Algorithm\\
& TA & Tabu search~\cite{GLOV1986j}\\
& SA & Simlulated Annealing \\ \hline
\end{tabular}
The main things to note are, to span multiple columns in a latex table you just use \multicolumn followed by the number of columns to span and how you want it positioned, e.g. l for left, r for right, c for centered. Spanning multiple rows in a latex table is the same, except using \multirow followed by the number of rows to span, and how you would like it positioned. * basically means best fit. Remember that the first element of each row needs to be empty, since you have some piece of information spanning multiple rows.
Thanks
\multirow{4}{110 pt}{Batch}
I couldn't get it to work the other way around, but this way it seems to.
Hope that helps!
My code is like this:
\begin{tabular}{|c|r|r|r|}
\hline
\multirow{2}{*}{1} & \multicolumn{3}{|c|}{2} \cr \hline
& A & B & C \cr \hline
\end{tabular}
Thanks!
\multirow{2}{*}{1} & \multicolumn{3}{|c|}{2} \cr \hline
replace \hline for \cline{2-4}
thank you anyway!
I was using "tabulary" package in order to have tables with a specific width, and also to use "multicolumn", but now I realize that "multirow" package enables both "multicolumn" and "multirow".
So, do you think "tabulary" and "multicolumn" packages are compatible, or not?
Also, where exactly does the \usepackage{multirow} command go in...you say at the top of the latex file....at the very top, before even \documentclass etc?
Cheers
Thanks
|EF | LL |
|TT | ttt |
Thanks!
I want to make a table with 3 columns. 1st and 2nd column has 3 rows and the 3rd should have only one row and this row..my code is:
\begin{table}[b!]
\caption{Numbering scheme.}\label{tab:sam}
\vspace{3mm}
\centering
\begin{tabular}[width=1\textwidth]{l|p{59mm}|p{65mm}}
\hline\hline
Sample & Compounds & Remarks \\
No.\ & &\\
\hline
1 & some thing & solid/powder \\
2 & sample~1 & prepared in open \\
3 & sample~2 & prepared in frozen\\
\hline
7 & 1~min & \\
8 & 5~min & \\
9 & 30~min & \\
\hline\hline
\end{tabular}
\end{table}
thanks
Thanks
_______________________________________________
Trigger FoV No. of Combinations
--------------------------------------
2-fold 3-fold
--------------------------------------
n21 n22 n31 n32
-----------------------------------------------------------------------
1 2x3 1 1 2 3
-----------------------------------------------------------------------
2 3x4 5 3 4 3
----------------------------------------------------------------------
3 5x6 4 2 5 4
-----------------------------------------------------------------------
It's extremely unlikely that the latex
\multirow{3}{*}{Immediate} & RR & Round Robin \\
produces the corresponding table line:-)
II 5.426 9.186 6.549
I 5.423 9.393 9.368
Does anybody know how to add centered items using \itemize in a column? I have done this using:
\begin{table}[h]
\centering
\begin{tabular}{|p{3cm}|p{7cm}|}
%1 row
\hline
%a column
First item %--------------------how to center this (row centered)?
%b column
&
\begin{itemize}
\item First item
\item Second item
\end{itemize} \\
%2 row
\hline
%a column
other
%b column
& \begin{itemize}
\item First item
\item Second item
\item 3 item
\end{itemize}\\
\hline
\end{tabular}
\end{table}