自動的に「-」を付けずに単語を 2 行目に表示するにはどうすればよいですか? たとえば、次のようになります。
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
。
まず第一に、デイヴィッド・カーライルの答え
>{\RaggedRight\arraybackslash}c
を に変更し、 (ハイフネーションが許可されている場合) または(ハイフネーションが許可されていない場合)にc
変更します。X
>{\RaggedRight\arraybackslash}X
>{\raggedright\arraybackslash}X
\tabcolsep
列間の空白の量を制御するパラメータ の値を 3 分の 1 減らします(デフォルト値 から6pt
まで4pt
)。最初の列の左側と最後の列の右側にある不要な空白スペースを削除します。
使用しないでください太字ヘッダー セルの場合、大きな影響を与える必要はありませんが、限られたスペースを大量に占有します。
ヘッダー セルの 1 つに略語を使用します。
\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
は1行のエントリなので、
>{\RaggedRight\arraybackslash}c
は\RaggedRight
何もしませんが、2番目のX
列を右に不揃いにしたいので、次のようX
に置き換えます。
>{\RaggedRight\arraybackslash}X