
첫 번째 부록에 대한 표를 만들려고 하는데 다음 두 가지 문제에 직면하고 있습니다.
- 첫 번째 열의 텍스트를 왼쪽으로 정렬하고 싶습니다.
- 열은 텍스트 너비를 따라 균등하게 분포되지 않습니다.
여기에 제가 사용하고 있는 코드와 그 결과를 보여드리겠습니다.
\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
세 개의 열 모두에 해당 열 유형을 사용합니다.
\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}