I want to align some specific cells inside a LaTeX
table. I tried using center enviroment
inside cell, but it didn't work-Error: Undefined Control Sequence \begin{center}
. I also tried with \centering
which produces no errors, however it doesn't do the job. My MWE is the following
\documentclass[11pt,a4paper]{article}
\usepackage[english,greek]{babel}
\usepackage[iso-8859-7]{inputenc}
\usepackage{kerkis}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{units}
\usepackage{array}
\begin{document}
\begin{table}[H]
\begin{center}
\begin{tabular}{l r r r}
\hline
{} & {\centering \textbf{Ενέργεια}} & {\centering \textbf{Ενέργεια}} & {\centering \textbf{Μέσος Αριθμός}}\\
{\textbf{Αέριο}} & {\centering \textbf{Διέγερσης}} & {\centering \textbf{Ιονισμού}} & {\centering \textbf{Παραγωγής Ζεύγους}}\\
{} & {\centering $[eV]$} & {\centering $[eV]$} & {}\\
\hline
{} & {} & {} & {} \\
{$Ar$} & {$11.6$} & {$15.8$} & {$26$} \\
{$CO_2$} & {$10.0$} & {$13.7$} & {$33$} \\
{$CH_4$} & {$12.6$} & {$14.5$} & {$28$} \\
{$Kr$} & {$10.0$} & {$14.0$} & {$24$} \\
{$Xe$} & {$8.4$} & {$12.1$} & {$22$} \\
\hline
\end{tabular}
\caption{Μέσος αριθμός παραγωγής ζεύγους για διάφορα αέρια}
\label{tab:Excitation-Ionization}
\end{center}
\end{table}
\end{document}
Best Answer
Update
Usage of the option
LGRx
is not needed any longer.A single cell alignment can be changed with
\multicolumn{1}{c}{...}
(for centering it).However I suggest you some improvements to your table:
I'd prefer UTF-8 to ISO-8859-7, also if it requires some juggling for typesetting Latin text.
Element symbols should be upright, as units. With
siunitx
it's easy to get correct alignment of numbers. Note the two alternative ways to express the eV unit.