# tabular with fixed column length and centered text

I'm trying to have a 2-columns table, with fixed length and text centered on each column. I've found an example in the LaTex documentation (p. 159) but when I try to compile it, it does not work. Here is my code:

\documentclass[12pt, openright, twoside, a4paper]{book}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english,french]{babel}
\newcommand{\bb}{\textbf}
\begin{document}

\begin{tabular}{|>{\centering}p{0.1\linewidth}|p{0.15\linewidth}|}
\hline
\textbf{SI} & \textbf{Gaussian} \tabularnewline
\hline \hline
$\bb{E}$ & $\bb{E}$ \tabularnewline
$\bb{D}$ & $\bb{D} / 4 \pi$ \tabularnewline
$\bb{H}$ & $c \bb{H} / 4 \pi$ \tabularnewline
$\bb{B}$ & $\bb{B} / c$ \tabularnewline
$\varepsilon_0$ & $1 / 4 \pi$ \tabularnewline
$\mu_0$ & $4 \pi / c^2$ \tabularnewline
$\rho_e$ & $\rho_e$ \tabularnewline
$\bb{J}$ & $\bb{J}$ \tabularnewline
\hline
\end{tabular}

\end{document}


I get:

./test.tex:10: Use of \@array doesn't match its definition.
\new@ifnextchar ...served@d = #1\def \reserved@a {
#2}\def \reserved@b {#3}\f...
l.10 ...ering}p{0.1\linewidth}|p{0.15\linewidth}|}

?


Any idea ? Where am I wrong ?

• Welcome to TeX.SE. The (admittedly nearly incomprehensible) error message is caused by a failure to load the array package. Load the package, and your code compiles without further incidents.
– Mico
Apr 26 '17 at 0:02
• Off-topic: Since all instances of \bb appear to occur whlle TeX is in math mode, the macro's definition really ought to be \newcommand{\bb}[1]{\mathbf{#1}}.
– Mico
Apr 26 '17 at 0:07
• @Mico Thanks a lot, you're right! A si simple solution for a so mysterious error message... And thanks for the hint on my \bb command ! Apr 26 '17 at 5:50

>{\centering}p{0.1\linewidth}

In order for LaTeX to be able to process this instruction, the array package must be loaded. Load the array package and your example code compiles without further incident.