
오른쪽 열의 텍스트 조각이 왼쪽 열의 텍스트 조각에 더 가깝기를 바랍니다. 동시에, 나는 지금처럼 긴 텍스트를 보기 좋게 수용할 수 있는 테이블을 원합니다. 이 결과를 얻는 한 가지 방법은 왼쪽 열의 너비를 제한하고, 오른쪽 열의 너비를 늘리고, 오른쪽 열의 왼쪽 여백을 왼쪽으로 이동하는 것입니다. 하지만 어떻게 해야 할지 모르겠습니다.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\begin{tabular}{*{2}{p{.425\linewidth}}}
\toprule
first & second second second second second second second second second second\\
\midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth fourth fourth \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
당신의 도움을 주셔서 감사합니다.
답변1
질문을 이해하는 한, 시도해 보겠습니다.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\begin{tabular}{l p{0.5\linewidth}}
\toprule
first & second second second second second second second second second second\\
\midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth fourth fourth \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
획득하다
답변2
@Werner가 이미 의견에서 지적했듯이 서식 지정 목표에 대한 좋은 후보 솔루션은 패키지를 로드하고 . 대신 환경(전체 너비를 로 설정 ) tabularx
을 사용하는 것입니다 . 그런 다음 첫 번째 열 사양을 에서 로 변경 하고 , 두 번째 열 사양을 에서 로 변경 합니다 .tabularx
\textwidth
tabular
p{...}
l
p{...}
X
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{tabularx} % for "tabularx" env. and "X" column type
\begin{document}
\begin{table}
\begin{tabularx}{\textwidth}{@{} l X @{}}
\toprule
first & second second second second second second second
second second second second second second second second \\
\midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth
fourth fourth fourth fourth \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}