Please
always provide a
complete example that is compilable as is for everybody. Otherwise specific help becomes very difficult especially when a problem is more complicated.
The quite new
tabu package makes typesetting of such tables much easier. And in general I would reorganize the table a little bit.
Code: Select all
\documentclass[11pt]{article}
\usepackage[T1]{fontenc} % Enable Cork Encoding (Type 1 EC fonts)
\usepackage[utf8]{inputenc} % Input encoding for special characters (if needed, optional)
\usepackage{caption} % Customize float captions
\usepackage{mathtools} % Loads »amsmath«
\usepackage{%
multirow, % Table entries over several rows
tabu % Enhance typesetting of tables
}
\usepackage{xcolor} % Enable colors
\usepackage{siunitx} % Format numbers and typeset physical units
\captionsetup{%
font=small,
labelfont=bf,
tableposition=top
}
\sisetup{%
load-configurations=abbreviations,
separate-uncertainty=true
}
\begin{document}
\begin{table}[!ht]
\caption{Table with gray border}\label{tab:border}
\centering
\setlength{\extrarowsep}{2pt}
\taburulecolor{gray}
\begin{tabu}{|[2pt,gray] c|[black] S|[black] S|[black] S|[2pt,gray]}\tabucline[2pt]{-}
{\multirow{2}{*}[2pt]{Index}} & {Caliper Width} & {Caliper Height} & {Caliper Length} \\[-4pt]
& {$w_\text{CB}$ ($\pm\SI{.01}{\cm}$)} & {$h_\text{CB}$ ($\pm\SI{.01}{\cm}$)} & {$l_\text{CB}$ ($\pm\SI{.01}{\cm}$)} \\ \taburulecolor{black} \hline
1 & 2.39 & 2.46 & 5.15 \\ \hline
2 & 2.33 & 2.48 & 5.17 \\ \hline
3 & 2.35 & 2.45 & 5.1 \\ \hline
4 & 2.33 & 2.48 & 5.16 \\ \hline
5 & 2.32 & 2.47 & 5.17 \\ \hline
6 & 2.3 & 2.49 & 5.16 \\ \hline
7 & 2.31 & 2.4 & 5.18 \\ \hline
8 & 2.40 & 2.47 & 5.14 \\ \hline
9 & 2.34 & 2.48 & 5.17 \\ \hline
10 & 2.32 & 2.49 & 5.15 \\ \hline
Avg & 2.34(3) & 2.47(3) & 5.16(2) \\ \taburulecolor{gray} \tabucline[2pt]{-}
\end{tabu}
\end{table}
\end{document}
The typesetting of numbers in general and their alignment in tables is enhanced by the
siunitx package. Have a look at the manuals of the involved packages to understand what they do (see comments in the code above).
Best regards and welcome to the board
Thorsten