[Tex/LaTex] Column spacing problem

spacingtables

I'd like to know how to position two columns in the following table closer together.
The table looks like this:

table

I have found I had a problem with spacing of tabular columns combined with \multicolumn. I found an inelegant solution. Perhaps someone knows of a better one? and Column and row padding in tables. Unfortunately, I still cannot get it to work. Consider the following code:

\begin{table}
\begin{mdframed}[style=schwarzelinie]
\begin{center}
\begin{threeparttable}
\caption{\textbf{Charakteristika 123}
\begin{tabular*}{1\columnwidth}{@{\extracolsep{\fill}}lS[table-alignment=center,table-column-width=0.02\columnwidth]S[table-alignment=center,input-symbols=(),table-column-width=0.02\columnwidth]}
\toprule 
 & \multicolumn{2}{c}{\textbf{Patienten: n(\%)}}\tabularnewline
\midrule
\midrule 
\textbf{Anzahl} & \multicolumn{2}{c}{59}\tabularnewline
\midrule 
\textbf{Dauer:} &  & \tabularnewline
- weniger als 1 Stunde & 8 & (13,6)\tabularnewline
- zwischen 1-3 Stunden & 23 & (39,0)\tabularnewline
- zwischen 4-72 Stunden & 26 & (44,1)\tabularnewline
- länger als 72 Stunden & 2 & (3,4)\tabularnewline
\midrule 
\textbf{Charakter:} &  & \tabularnewline
- ausschließlich anfallsartig & 45 & (76,3)\tabularnewline
- ausschließlich stetig & 12 & (22,0)\tabularnewline
- stetig und anfallsartig alternierend & 1 & (1,7)\tabularnewline
\end{tabular*}\begin{tablenotes}[para,flushleft]
\textbf{Erläuterungen:} Einige Erklaerungen. 
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{mdframed}
\end{table}

Best Answer

It appears that the layout issues arise because the instruction \extracolsep{\fill}} inserts equal amounts of column whitespace between columns 2 and 3 as it does between columns 1 and 2, in order to increase the table's total width to \columnwidth. Not knowing what other design parameters you have to satisfy, I'd say the easiest solution is to change the first column's type from l to p{0.65\texwidth}, as is done in the following MWE.

By the way, it would help if you posted full MWEs. They're not that much longer than the code you do post, and doing so would help save time for people potentially interested in helping you solve your issues, say by not making them go through a guessing game regarding the additional packages that must be loaded in order to get the code to compile.

enter image description here

\documentclass{article}
\usepackage{booktabs,mdframed,siunitx,threeparttable}
\sisetup{output-decimal-marker={,},input-symbols= () }
\begin{document}
\begin{table}
\begin{mdframed}[style=schwarzelinie]
\begin{threeparttable}
\caption{\textbf{Charakteristika 123}}
\begin{tabular*}{\columnwidth}{@{\extracolsep{\fill}}
   p{0.65\columnwidth}
   S[table-format=2.0] S}
\toprule 
& \multicolumn{2}{c}{\textbf{Patienten}}\\ 
\cmidrule(l){2-3}
& {n} & {(\%)} \\   
\midrule
\textbf{Anzahl} & 59 & (100,0)\\    
\midrule 
\textbf{Dauer:}\\    
- weniger als 1 Stunde    &  8 & (13,6)\\    
- zwischen 1-3 Stunden    & 23 & (39,0)\\    
- zwischen 4-72 Stunden   & 26 & (44,1)\\    
- l\"anger als 72 Stunden &  2 &  (3,4)\\    
\midrule 
\textbf{Charakter:}\\    
- ausschlie\ss lich anfallsartig       & 45 & (76,3)\\    
- ausschlie\ss lich stetig             & 12 & (22,0)\\    
- stetig und anfallsartig alternierend &  1 &  (1,7) 
\end{tabular*}
\begin{tablenotes}[para,flushleft]
\textbf{Erl\"auterungen:} Einige Erkl\"arungen. 
\end{tablenotes}
\end{threeparttable}
\end{mdframed}
\end{table}
\end{document}