0

I am trying to create a table for my first appendix but I am facing the two following problems:

  • I would like to align the text of the first column to the left.
  • The columns are not equally distributed along the width of the text.

I show you here the code I am using and the result of it:

\usepackage{float}
\usepackage{adjustbox}
\usepackage{multicol}
\usepackage{longtable}

\renewcommand*\descriptionlabel[1]{\hspace\leftmargin$#1$}
\usepackage{array,ragged2e}
\newcolumntype{C}{>{\Centering\hspace{0pt}}p{0.1\textwidth}}
\usepackage[output-decimal-marker={,}]{siunitx}
\usepackage{booktabs, makecell, tabularx}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}


\appendix
\section{Suppliers´ production capacities}
\begin{table}[ht]
\setcellgapes{3pt}
\makegapedcells
\begin{tabularx}{\linewidth}{@{}ccL@{}}
\toprule
Facility Name & Year & Overall Capacity \\
\midrule
Text    & 2020                              & 1.500                                                    \\
Text   & 2020                              & 1.600                                                    \\
Text          & 2020                              & 2.500                                                    \\
                               
 \bottomrule
\end{tabularx}
  \caption{Supplier facilities´ production capacities}
\end{table}

enter image description here I would be extremely grateful if someone can help me with this

1
  • 1
    \begin{tabularx}{\linewidth}{@{}LLL@{}}should fulfill both requirements. However, I would not recommend artifically stretching a narrow table to the textwidth as the added white space does not increase readability. \begin{tabular}{@{}lcc@{}} should be sufficient here.
    – leandriis
    Commented Sep 4, 2020 at 8:07

1 Answer 1

1

I would like to align the text of the first column to the left.

Just change

\begin{tabularx}{\linewidth}{@{}ccL@{}}

to

\begin{tabularx}{\linewidth}{@{}lcL@{}}

The columns are not equally distributed along the width of the text.

How about

\begin{tabularx}{\linewidth}{@{}LLL@{}}

i.e., use the L column type for all three columns.

enter image description here

\documentclass{article}
\usepackage{tabularx,ragged2e,booktabs}
\newcolumntype{L}{>{\RaggedRight}X}

\begin{document}
\begin{table}[ht]
\begin{tabularx}{\linewidth}{@{} LLL @{}}
\toprule
Facility Name & Year & Overall Capacity \\
\midrule
Text & 2020 & 1.500  \\
Text & 2020 & 1.600  \\
Text & 2020 & 2.500  \\
\bottomrule
\end{tabularx}
\caption{Supplier facilities' production capacities}
\end{table}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .