Ajustando uma tabela dentro do texto

Ajustando uma tabela dentro do texto

Estou tentando criar uma tabela para meu primeiro apêndice, mas estou enfrentando os dois problemas a seguir:

  • Gostaria de alinhar o texto da primeira coluna à esquerda.
  • As colunas não estão distribuídas igualmente ao longo da largura do texto.

Mostro aqui o código que estou usando e o resultado dele:

\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}

insira a descrição da imagem aqui Ficarei extremamente grato se alguém puder me ajudar com isso

Responder1

Gostaria de alinhar o texto da primeira coluna à esquerda.

Apenas mude

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

para

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

As colunas não estão distribuídas igualmente ao longo da largura do texto.

Que tal

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

ou seja, use o Ltipo de coluna para todas as três colunas.

insira a descrição da imagem aqui

\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}

informação relacionada