TransWikia.com

Unwanted indentation in first column of tabular

TeX - LaTeX Asked on July 19, 2021

I have a strange indentation of the first column I just can’t get rid of. Anyone has ideas whats wrong?

documentclass{article}
usepackage{multicol}                           % define a multicols environment which 
usepackage{array}
begin{document}

begin{table}
    footnotesize
    renewcommand{arraystretch}{1.3}%
    begin{tabular*}{textwidth}{ @{extracolsep{fill}}l >{hspace{0.02textwidth}}l >{centering}b{0.23textwidth} >{centering}b{0.23textwidth}}%
        
        multicolumn{1}{b{0.15textwidth}}{Behaviouralbreak intentions} & multicolumn{1}{c}{Path} & Serial Mediation Effects (textit{without} control of RF) with 95%-CI & Serial Mediation Effects (textit{with} control of RF) break with 95%-CI  tabularnewline 
        
        KB & BEG $rightarrow$ MU $rightarrow$ GA $rightarrow$ KB & 0,06 hspace{0.02textwidth} [0,03; 0,10] & 0,01 hspace{0.02textwidth} [-0,02; 0,04] tabularnewline
        
        WOM & BEG $rightarrow$ MU $rightarrow$ GA $rightarrow$ WOM & 0,06 hspace{0.02textwidth} [0,03; 0,10] & 0,01 hspace{0.01textwidth} [-0,02; 0,05] tabularnewline
        
        MPB & BEG $rightarrow$ MU $rightarrow$ GA $rightarrow$ MPB & -0,04 hspace{0.02textwidth} [-0,08; -0,01] & -0,01 hspace{0.02textwidth} [-0,03; 0,01] tabularnewline
        
    end{tabular*} 
end{table}

end{document}

One Answer

Addint the @{} into the multicolumn command as in multicolumn{1}{@{}b{0.15textwidth}}{Behavioural intentions} results in "Behavioural" being horizontally aligned with the other contents in the first column.

Since the table is wider than the textwidth and all the manual spacing and distances seem a bit compilcated, I added a second alternative version of the table that you might also like:

enter image description here

documentclass{article}

usepackage{array}
begin{document}

begin{table}
    footnotesize
    renewcommand{arraystretch}{1.3}%
    begin{tabular*}{textwidth}{ @{extracolsep{fill}}l >{hspace{0.02textwidth}}l >{centering}b{0.23textwidth} >{centering}b{0.23textwidth}}%
        
        multicolumn{1}{@{}b{0.15textwidth}}{Behaviouralbreak intentions} & multicolumn{1}{c}{Path} & Serial Mediation Effects (textit{without} control of RF) with 95%-CI & Serial Mediation Effects (textit{with} control of RF) break with 95%-CI  tabularnewline 
        
        KB & BEG $rightarrow$ MU $rightarrow$ GA $rightarrow$ KB & 0,06 hspace{0.02textwidth} [0,03; 0,10] & 0,01 hspace{0.02textwidth} [-0,02; 0,04] tabularnewline
        
        WOM & BEG $rightarrow$ MU $rightarrow$ GA $rightarrow$ WOM & 0,06 hspace{0.02textwidth} [0,03; 0,10] & 0,01 hspace{0.01textwidth} [-0,02; 0,05] tabularnewline
        
        MPB & BEG $rightarrow$ MU $rightarrow$ GA $rightarrow$ MPB & -0,04 hspace{0.02textwidth} [-0,08; -0,01] & -0,01 hspace{0.02textwidth} [-0,03; 0,01] tabularnewline
        
    end{tabular*} 
end{table}

begin{table}
    footnotesize
    setlength{tabcolsep}{0pt}
    renewcommand{arraystretch}{1.3}%
    begin{tabular*}{textwidth}{@{extracolsep{fill}}l  l *{4}{>{(}r<{)}r}}%
        
        Behavioural  & multicolumn{1}{c}{Path} & multicolumn{4}{c}{Serial Mediation Effects with 95%-CI} 
        intentions   &                          & multicolumn{2}{c}{(textit{without} control of RF)} &  multicolumn{2}{c}{(textit{with} control of RF)}   
        
        KB & BEG $rightarrow$ MU $rightarrow$ GA $rightarrow$ KB & 0,06 & [0,03; 0,10] & 0,01 & [-0,02; 0,04] 
        
        WOM & BEG $rightarrow$ MU $rightarrow$ GA $rightarrow$ WOM & 0,06 & [0,03; 0,10] & 0,01 & [-0,02; 0,05] 
        
        MPB & BEG $rightarrow$ MU $rightarrow$ GA $rightarrow$ MPB & -0,04 & [-0,08; -0,01] & -0,01 & [-0,03; 0,01] 
        
    end{tabular*} 
end{table}

end{document}

Correct answer by leandriis on July 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP