Random Notes from My Research Life @ IISc

March 13, 2012

Nice tables using Latex

Filed under: Latex,ResearchLife,Uncategorized — Sooraj K. Ambat @ 14:16
Tags: , , ,

Here, we’ll show how to improve the default appearance of a table in \LaTeX.

The following commands will produce the default style table in \LaTeX. (Refer Table I)

\begin{table}[htbp]
\caption{Default Table}
\label{Tab:SRNRValues}
\begin{center}
\begin{tabular}{|c|c|c|c|}
\hline
\multirow{2}{1.5cm}{Method}& \multicolumn{3}{p{5cm}|}{\centering Measurements} \\
\cline{2-4} & \multicolumn{1}{c|}{Clean} & \multicolumn{1}{c|}{SMNR=15 dB} & \multicolumn{1}{c|}{SMNR = 10 dB} \\ \hline
Type1 & 27.54 & 13.23 & 6.80 \\
Type2 & 29.55 & 9.61 & 6 \\
Type3 & 25.99 & 11.49 & 6.15 \\
\hline
\end{tabular}
\end{center}
\end{table}

* The following modifications will make the table look more attractive. (Refer Table II).

You need to include additional packages using commands

\usepackage{multirow}
\usepackage{bigstrut}

\renewcommand{\multirowsetup}{\centering} %to align center inside the table
\setlength{\tabcolsep}{10pt}
\begin{table}[htbp]
\caption{A Nice Table}
\label{Tab:SRNRValues}
\begin{center}
\begin{tabular}{|c|c|c|c|}
\hline
\multirow{2}{1.5cm}{Method}& \multicolumn{3}{p{5cm}|}{\centering Measurements} \bigstrut \\
\cline{2-4} & \multicolumn{1}{c|}{Clean} & \multicolumn{1}{c|}{SMNR=15 dB} & \multicolumn{1}{c|}{SMNR = 10 dB} \bigstrut \\ \hline
Type1 & 27.54 & 13.23 & 6.80 \bigstrut \\
Type2 & 29.55 & 9.61 & 6 \bigstrut \\
Type3 & 25.99 & 11.49 & 6.15 \bigstrut \\
\hline
\end{tabular}
\end{center}
\end{table}

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: