# Why is the left alignment leaving space in table?

I have this:

\documentclass{article}

\usepackage{longtable, array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\begin{document}

\begin{longtable}{|L{0.2\textwidth}|L{0.2\textwidth}L{0.2\textwidth}L{0.2\textwidth}|}\hline
\multicolumn{1}{|c|}{\large Physical Properties} &
\multicolumn{1}{c|}{\large Solid} &
\multicolumn{1}{c|}{\large Liquid} & \multicolumn{1}{c|}{\large Gas} \\ \hline
Shape & Definite & Indefinite & Indefinite \\ \hline
Volume & Definite & Definite & Indefinite \\ \hline
Force of Attraction & Very Strong & Less than solid & Least \\ \hline
Fluidity & Doesn't flow & Can flow & Can blow \\ \hline
Compressibility & Can't be compressed & Can't be compressed & Highly compressed \\ \hline
Diffusion & Very Slow & Fast & Fastest \\ \hline
\end{longtable}

\end{document}


which produces (the unwanted spaces are marked in yellow):

The items in the leftmost column are aligned to the left (as wanted) but leave some space before beginning.

How to fix this? Thanks!

• @JohnKormylo Could you please add an answer? I tried but it shows an error saying Misplaced \omit (due to the \multicolumn maybe?) Apr 12, 2021 at 12:27

Prescribed width of the first column is smaller than width of the \multicolumn cell in it. Simpler remedy is to use natural width for this column:

\documentclass{article}

\usepackage{array, longtable}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}m{#1}}
\NewExpandableDocumentCommand\mcc{O{c|}m}{\multicolumn{1}{#1}{#2}}

\begin{document}
\setlength\extrarowheight{2pt}
\setlength\tabcolsep{4pt}
\begin{longtable}{|l | *{3}{L{0.2\textwidth}|} }
\hline
\large Physical Properties
&   \mcc{\large Solid}
& \mcc{\large Liquid}
& \mcc{\large Gas}                              \\ \hline
Shape       & Definite      & Indefinite    & Indefinite    \\ \hline
Volume      & Definite      & Definite      & Indefinite    \\ \hline
Force of Attraction
& Very Strong   & Less than solid
& Least         \\ \hline
Fluidity    & Doesn't flow  & Can flow      & Can blow      \\ \hline
Compressibility
& Can't be compressed
& Can't be compressed
& Highly compressed \\ \hline
Diffusion   & Very Slow     & Fast          & Fastest           \\ \hline
\end{longtable}

\end{document}


I wonder, if you really need longtable for this table? If it is shorter than one page, is sensible (at least to my opinion) to use tabularx table. In this case you not need to take a care that table is not wider to \textwidth:

\documentclass{article}

\usepackage{tabularx}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\NewExpandableDocumentCommand\mcc{O{c|}m}{\multicolumn{1}{#1}{#2}}

\begin{document}

\setlength\extrarowheight{2pt}
\noindent
\begin{tabularx}{\linewidth}{|l | *{3}{L|} }
\hline
\large Physical Properties
&   \mcc{\large Solid}
& \mcc{\large Liquid}
& \mcc{\large Gas}                              \\ \hline
Shape       & Definite      & Indefinite    & Indefinite    \\ \hline
Volume      & Definite      & Definite      & Indefinite    \\ \hline
Force of Attraction
& Very Strong   & Less than solid
& Least         \\ \hline
Fluidity    & Doesn't flow  & Can flow      & Can blow      \\ \hline
Compressibility
& Can't be compressed
& Can't be compressed
& Highly compressed \\ \hline
Diffusion   & Very Slow     & Fast          & Fastest           \\ \hline
\end{tabularx}

\end{document}


Result is almost the same as before.

Addendum: If table is longer than one page, you may consider to use xltabular table. Beside this, considering your question in comment below, use makecell and booktabs packages, without vertical rules:

\documentclass{article}

\usepackage{booktabs, makecell, xltabular}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}

\begin{document}

\begingroup
\setcellgapes{2pt}
\makegapedcells
\begin{xltabular}{\linewidth}{ L{1.15} *{3}{L{0.95}} }
\toprule
\midrule
Shape       & Definite      & Indefinite    & Indefinite    \\
Volume      & Definite      & Definite      & Indefinite    \\
Force of Attraction
& Very Strong   & Less than solid
& Least         \\
Fluidity    & Doesn't flow  & Can flow      & Can blow      \\
Compressibility
& Can't be compressed
& Can't be compressed
& Highly compressed \\
Diffusion   & Very Slow     & Fast          & Fastest           \\
\bottomrule
\end{xltabular}
\endgroup

\end{document}


• Actually, this table is a part of a bigger project, so I use longtables to be carefree of pagebreaks. Apr 12, 2021 at 14:06
• I just wanted to ask, how do I manage if there is an item in left most column that exceeds the width of Physical Properties, taking into account I don't want the text area to increase further? Apr 12, 2021 at 14:13
• @BookOfFlames, that is mater of personal preference. I would design your table quite differently: without vertical lines, with rules defined in the booktabs package and for column headers use makecell package enabling two line text in them and also not increase font size in the columns headers. Apr 12, 2021 at 14:20

You must increase width of first column.

\documentclass{article}

\usepackage{longtable, array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\begin{document}

\begin{longtable}{|L{0.3\textwidth}|L{0.2\textwidth}L{0.2\textwidth}L{0.2\textwidth}|}
\hline
\multicolumn{1}{|c|}{\large Physical Properties} &
\multicolumn{1}{c|}{\large Solid} &
\multicolumn{1}{c|}{\large Liquid} & \multicolumn{1}{c|}{\large Gas} \\ \hline
Shape & Definite & Indefinite & Indefinite \\ \hline
Volume & Definite & Definite & Indefinite \\ \hline
Force of Attraction & Very Strong & Less than solid & Least \\ \hline
Fluidity & Doesn't flow & Can flow & Can blow \\ \hline
Compressibility & Can't be compressed & Can't be compressed & Highly compressed \\ \hline
Diffusion & Very Slow & Fast & Fastest \\ \hline
\end{longtable}

\end{document}