# Odd behaviour when dashes are add in a table?

Using the following MWE :

\documentclass[12pt,a4paper]{report}
\usepackage[lmargin=3.81cm,tmargin=2.54cm,rmargin=2.54cm,bmargin=2.52cm]{geometry}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{multirow}

\begin{document}

\begin{table}[H]
\parskip-5pt
\centering
\begin{tabular}{llS[table-format=4.0]}
\toprule
\midrule
\textbf{Background} & Fans (Slide) & 350\--- 600\--- 750 \\
& Dehumidifier (Therm)  & 500\--- 620\--- 785  \\
& Refrigerator (Therm) & 480\--- 580\--- 725 \\
& Heater (Therm) & 750\--- 1000\--- 1500 \\
\bottomrule
\end{tabular}
\label{powertable2}
\end{table}

\end{document}

I get the following table :

But when I remove the dashes I get :

As you can see in the second pic, the numbers are centered. I want the numbers to remain centered even when I use the dashes \---. Why do they indent to the right when dashes are added ?

-
why don't you use -- instead of \---? – Mario S. E. Apr 27 '13 at 19:28
The S column is meant for one number, not many. Just use three S. By the way, \--- is not the same as --- (an em-dash), in fact \--- is an optional hyphen (\-) and an en-dash --. – Qrrbrbirlbel Apr 27 '13 at 19:28
@MarioS.E. I get a siuntix error if I do that – Razor Apr 27 '13 at 19:31
@Qrrbrbirlbel But I don't want to split into 3 columns (is that was adding extra S's do ? ) I tried that and the table blew out of proportions. – Razor Apr 27 '13 at 19:32
@Razor Well, either that, or manual adjusting. S does not work that way. – Qrrbrbirlbel Apr 27 '13 at 19:35

The S column does only parse one number, you will need to use three S columns with the dash between them, e.g.

\begin{tabular}{llS@{--}S@{--}S}

but the problem is the wide column heading Power Consumption (kWh) which (even combined with \multicolumn) doesn't work well with three very small columns.

For such simple values, this might be easier.

## Code

\documentclass[12pt,a4paper]{report}
\usepackage[lmargin=3.81cm,tmargin=2.54cm,rmargin=2.54cm,bmargin=2.52cm]{geometry}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{multirow}
\newcommand*{\0}{\hphantom{0}}
\begin{document}
\begin{table}[H]
%    \parskip-5pt
\centering
\begin{tabular}{llc}
\toprule
\multicolumn{2}{c}{\textbf{Loads}}     & \textbf{Power Consumption} (\si{kWh}) \\ \midrule
\textbf{Background} & Fans (Slide)         &           350--\0600--\0750           \\
& Dehumidifier (Therm) &           500--\0620--\0785           \\
& Refrigerator (Therm) &           480--\0580--\0725           \\
& Heater (Therm)       &            750--1000--1500            \\ \bottomrule
\end{tabular}
\label{powertable2}
\end{table}
\end{document}

## Output

-
Thank you very much. I didn't expect it to be this difficult (compared to MS Word that is). I would have never guessed how to do this :S – Razor Apr 27 '13 at 19:42