In this table the column headers of the number columns formatted with siunitx seem to be centered. Is there a way to align them to the right, so that the column header itself is right aligned and ends in one line with the percentage sign?
Edit: Extended to Minimum Working Example
The LaTeX code for the table looks like this. I compile it with XeLaTeX.
\documentclass[11pt, a4paper, oneside]{article}
% Packages
\usepackage[utf8]{inputenc}
\usepackage{fontspec}
\usepackage{fullpage}
\usepackage{fancyhdr}
\usepackage{fancybox}
\usepackage{parskip}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage[usegeometry]{typearea}% before geometry!
\usepackage[landscape]{geometry}
\geometry{
left=0.5in, right=0.5in, top=0.6in, bottom=1in,headheight=23pt,includehead
}
\newcommand*{\useportrait}{%
\clearpage
\KOMAoptions{paper=portrait,DIV=current}%switch to portrait
\newgeometry{% geometry settings for portrait
left=0.5in, right=0.5in, top=0.6in, bottom=1in,headheight=23pt,includehead
}%
\fancyhfoffset{0pt}% <- recalculate head and foot width for fancyhdr
}
\newcommand*{\uselandscape}{%
\clearpage
\KOMAoptions{paper=landscape,DIV=current}%switch to landscape
\newgeometry{% geometry settings for landscap
left=0.5in, right=0.5in, top=0.6in, bottom=1in,headheight=23pt,includehead
}%
\fancyhfoffset{0pt}% recalculate head and foot width for fancyhdr
}
\sisetup{
round-mode = places,
group-digits = true,
output-decimal-marker = {.},
group-separator = {,},
detect-all
}
% Settings
\setmainfont{Calibri}
\geometry{paper=a4paper, left=20mm, right=20mm, top=25mm, bottom=25mm}
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[R]{\footnotesize\thepage}
% Caption
\setlength{\abovecaptionskip}{1pt}
% Page breaks
\let\oldsection\section
\renewcommand\section{\clearpage\oldsection}
% List of figures/tables
\renewcommand{\listfigurename}{Figures}
\renewcommand{\listtablename}{Tables}
\newcommand{\specialcell}[2][c]{%
\begin{tabular}[#1]{@{}c@{}}#2\end{tabular}}
\begin{document}
\uselandscape
\section{Global Equities}
\begin{tabular}{p{7cm}S[table-format=2.1, round-precision=1, table-column-width=2cm]S[table-format=2.1, round-precision=1, table-column-width=2cm]S[table-format=2.1, round-precision=1, table-column-width=2cm]S[table-format=2.1, round-precision=1, table-column-width=2cm]S[table-format=2.1, round-precision=1, table-column-width=2cm]S[table-format=2.1, round-precision=1, table-column-width=2cm]S[table-format=2.1, round-precision=1, table-column-width=2cm]S[table-format=2.1, round-precision=1, table-column-width=2cm]}
\midrule
{} & {\specialcell{Stock Market \\ Crash \\ 1973-1974}} & {\specialcell{Bear Market \\ 1980-1982}} & {\specialcell{Stock Market \\ Crash \\ 1987}} & {\specialcell{Gulf War \\ 1990}} & {\specialcell{Dot-Com Bubble \\ 2000}} & {\specialcell{Financial \\ Crisis \\ 2008}} & {\specialcell{Equity Markets \\ Rebound \\ 2009}} & {\specialcell{Oil Prices \\ Drop \\ 2010}} \\
\toprule
Nexi SpA & -72.5\si{\percent} & -37.2\si{\percent} & -34.7\si{\percent} & -30.1\si{\percent} & -58.0\si{\percent} & -76.1\si{\percent} & 65.0\si{\percent} & -10.6\si{\percent} \\
Fiserv Inc & -49.9\si{\percent} & 12.8\si{\percent} & -44.1\si{\percent} & -27.5\si{\percent} & -2.6\si{\percent} & -41.5\si{\percent} & 32.6\si{\percent} & -8.2\si{\percent} \\
\bottomrule
\end{tabular}
\end{document}
\specialcell
defined?\documentclass{...}
, the required\usepackage
's,\begin{document}
, and\end{document}
. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.