자동으로 '-'를 넣지 않고 단어를 두 번째 줄로 이동시키는 방법은 무엇입니까? 예를 들어:
Example
-->Ex- ample
테이블 길이를 조정하려고 했으나 여전히 불가능합니다. 나는 사용하는 것을 선호한다tabularx
시도해 보았 \space
으나 이상해 보입니다.
\documentclass[12pt,oneside]{book}
\usepackage{tabularx}
\usepackage{booktabs, ragged2e}
\begin{document}
\begin{table}[h!]
\centering
\begin{tabularx}{\textwidth}{>{\RaggedRight\arraybackslash}c X c c c c c }
\toprule
& & \multicolumn{2}{>{\centering\arraybackslash}p{8em}}{\textbf{95\% Confidence Interval of the Difference}} & \textbf{t}
& \textbf {df}
& \textbf {Sig.(2-tailed)} \\
\cmidrule{3-4}
& & \multicolumn{1}{c}{\textbf{Lower}} & \multicolumn{1}{c}{\textbf{Upper}} & & &\\
\midrule
Pair 1 & Fruit Fruit Example Dataset (AA) - Fruit Fruit Example Dataset (BB) & 34.33\% & 34.33\% & 34.33 & 34.33 & 34.33\\
\bottomrule
\end{tabularx}
\end{table}
\end{document}
답변1
tabularx
환경을 다음과 같이 재구성하겠습니다 .
무엇보다도 David Carlisle의 글에서 이미 제안한 바와 같이답변, (하이픈 넣기가 허용되는 경우) 또는 (그렇지 않은 경우) 로 변경
>{\RaggedRight\arraybackslash}c
하고c
변경합니다 .X
>{\RaggedRight\arraybackslash}X
>{\raggedright\arraybackslash}X
열 사이 공백의 양을 제어하는 매개변수 값을
\tabcolsep
1/3로 줄입니다(기본값 ~6pt
~4pt
).첫 번째 열의 왼쪽과 오른쪽 또는 마지막 열의 불필요한 공백 패딩을 잘라냅니다.
사용하지 마세요볼드체헤더 셀의 경우 영향을 미칠 필요는 없지만 부족한 공간을 많이 차지합니다.
헤더 셀 중 하나에 약어를 사용하세요.
\documentclass[12pt,oneside]{book}
\usepackage{tabularx,booktabs}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\newcommand\smalltab[1]{%
\begin{tabular}[t]{@{}c@{}}#1 \end{tabular}}
\begin{document}
\begin{table}[h!]
\setlength\tabcolsep{4pt} % default value: 6pt
%%%\centering
\begin{tabularx}{\textwidth}{@{} c L *{5}{c} @{}}
\toprule
& & \multicolumn{2}{c}{\smalltab{95\% Conf.\ Int.\\ of Difference}} & $t$ & df & \smalltab{Significance\\(2-tailed)} \\
\cmidrule(lr){3-4}
& & Lower & Upper \\
\midrule
Pair 1 & Fruit Fruit Example Dataset (AA) -- Fruit Fruit Example Dataset (BB)
& 34.33\% & 34.33\% & 34.33 & 34.33 & 34.33\\
\bottomrule
\end{tabularx}
\end{table}
\end{document}
답변2
c
한 줄 항목이므로 할 수 없습니다
>{\RaggedRight\arraybackslash}c
아무 작업 \RaggedRight
도 수행하지 않지만 두 번째 X
열을 올바르게 정렬하려면 다음 X
으로 바꾸십시오.
>{\RaggedRight\arraybackslash}X