I have made following table which is not looking elegant. Could anybody help me in making it more better. Following is the tex code that I have used.
\documentclass[12pt]{article}
\usepackage{latexsym}
\usepackage{amsmath, times, amsfonts, mathrsfs, amssymb}
\usepackage{amsmath, times, amsfonts, mathrsfs, amssymb}
\begin{document}
\begin{table}[htbp]
\small \caption{\small Computation of number of iterations and error norms for Example 4.2:}
\centering
\begin{tabular}{c c c c c c c}
\hline
Value of $\beta$ & $k$ & $\|A^{-1} - X_{k}\|_2$ & $\|X_k - X_{k-1}\|_2$ \\ [0.3ex] % inserts table
& & & & & & \\
%
\hline
0.9 & 0 & 0.489897948556636 & 0.462668212869655 \\
& 1 & 0.044911860348910 & 0.044385148438250 \\
& 2 & 6.418447480230614e-004 & 6.417891668548070e-004 \\
& 3 & 5.683044758299918e-008 & 5.683044739894235e-008 \\
& 4 & 1.861900614935455e-016 & 1.861900614935455e-016 \\
& 5 & 0 & 0 \\ [1ex]
\hline
\end{tabular}
\label{table:nonlin}
\end{table}
\end{document}
Best Answer
This seems a job for
booktabs
andsiunitx
. The first provides good horizontal rules with appropriate spacing, the second is specialized in typesetting numbers with or without units of measure.Type
S
columns make alignments at the decimal point; one can specify the number format:means one digit for the integer part and 15 for the fractional part;
means "keep two digits for the exponent";
means that the exponent can be negative.