0%

LaTeX Commands for Tables

LaTeX codes for inserting tables.

Basic

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
\usepackage{booktabs}

\begin{table}[t]
\centering
\caption{exmp}
\label{tb:exmp}
\begin{tabular}{ccc}
\toprule
& data1 & data2 \\
\midrule
alg1 & & \\
alg2 & & \\
\bottomrule
\end{tabular}
\end{table}

Multi-row and Multi-col

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
\usepackage{booktabs}
\usepackage{multirow}

\begin{table*}[t]
\centering
\caption{exmp}
\label{tb:exmp}
\begin{tabular}{ccccc}
\toprule
\multirow{2}{*}{alg} & \multicolumn{2}{c}{A} & \multicolumn{2}{c}{B} \\
\cmidrule(r){2-3} \cmidrule(r){4-5}
& A1 & A2 & B1 & B2 \\
\midrule
alg1 & & & & \\
alg2 & & & & \\
\bottomrule
\end{tabular}
\end{table*}