
tabularx を使用して単純な 3 列のテーブルを作成しようとしていますが、テーブルが明らかに機能していないため、コードの一部を誤解しているに違いありません。
私の目標は、3 つの列の幅を均等にすることですが、何を試しても行が一致しないようです。(テキストを中央揃えにし、「information」を 1 つの単語にすることも必要ですが、これらの問題は比較的軽微です。)
テーブルを作成するためのコードは以下の通りです。
\caption{Common Curriculum}
\centering
\begin{tabularx}{0.9\linewidth}[ht]{||p{0.3\linewidth} | p{0.3\linewidth} | p{0.3\linewidth}||}
\hline
Physical Concepts & Mathematical Skills and Notation & Application in Quantum Information \\
\hline\hline
1 & 6 & 87837 \\
\hline
2 & 7 & 78 \\
\hline
3 & 545 & 778 \\
\hline
4 & 545 & 18744 \\
\hline
5 & 88 & 788 \\
\hline
\end{tabularx}
\label{tab:CommonCurr}.
\end{table}
{\textwidth}
の代わりにを使用しようとしました{0.9\linewidth}
。また、テキスト幅の 3 分の 1 を使用することも試みましたが、水平線がテーブルを超えて拡張され、逆の問題が発生しているため、そのアイデアの問題は丸めによるものだと想定しました。
ご協力いただければ幸いです。
答え1
次の表形式は気に入っていただけるでしょうか:
上記の「プロフェッショナルな」表の AZ 記述では、tabularray
ライブラリ (同じ名前のパッケージをロードする) を含むパッケージと、少し狭い表が使用されています。
\documentclass{article}
\usepackage[skip=0.33\baselineskip]{caption}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
\begin{document}
\begin{table}[ht]
\caption{Common Curriculum}
\label{tab:CommonCurr}
\centering
\begin{tblr}{width=0.75\linewidth,
colspec = {X[c]
X[c, si={table-format=3.0}]
X[c, si={table-format=5.0}]},
row{even} = {belowsep=-2pt},
row{1} = {guard, c}
}
\toprule
{Physical\\ Concepts}
& Mathematical Skills and Notation
& Application in Quantum Information \\
\midrule
1 & 6 & 87837 \\
2 & 7 & 78 \\
3 & 545 & 778 \\
4 & 545 & 18744 \\
5 & 88 & 788 \\
\bottomrule
\end{tblr}
\end{table}
\end{document}
ただし、質問に示されているように、水平線と垂直線の「刑務所」内の各セルを好む場合は、MWE は次のようになります。
\documentclass{article}
\usepackage[skip=0.33\baselineskip]{caption}
\usepackage{tabularray}
\UseTblrLibrary{siunitx}
\begin{document}
\begin{table}[ht]
\caption{Common Curriculum}
\label{tab:CommonCurr}
\centering
\begin{tblr}{width=0.75\linewidth,
hlines, vlines,
colspec = {X[c]
X[c, si={table-format=3.0}]
X[c, si={table-format=5.0}]},
row{1} = {guard, c}
}
{Physical\\ Concepts}
& Mathematical Skills and Notation
& Application in Quantum Information \\
1 & 6 & 87837 \\
2 & 7 & 78 \\
3 & 545 & 778 \\
4 & 545 & 18744 \\
5 & 88 & 788 \\
\end{tblr}
\end{table}
\end{document}
そして表は次のようになります: