
最初の付録の表を作成しようとしていますが、次の 2 つの問題に直面しています。
- 最初の列のテキストを左揃えにしたいと思います。
- 列はテキストの幅に沿って均等に分散されていません。
ここで私が使用しているコードとその結果を示します。
\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}
答え1
最初の列のテキストを左揃えにしたいと思います。
ただ変えるだけ
\begin{tabularx}{\linewidth}{@{}ccL@{}}
に
\begin{tabularx}{\linewidth}{@{}lcL@{}}
列はテキストの幅に沿って均等に分散されていません。
いかがでしょうか
\begin{tabularx}{\linewidth}{@{}LLL@{}}
つまり、L
3 つの列すべてに列タイプを使用します。
\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}