
テーブルの右上のセルを中央揃え (垂直および水平) にしようとしていますtabularx
が、水平方向しか揃えられませんでした。必要なパッケージをプリアンブルにインポートしました。Y
定義は次のとおりです。
\newcolumntype{Y}{>{\centering\arraybackslash}X}
これが私のコードです:
\begin{table}[H]
\centering
\begin{tabularx}{\textwidth}{|*{6}{Y|}}
\hline
Concentration of L-Ascorbic Acid in the Reaction Mixture$\;/\;\mathrm{M}$ & \multicolumn{5}{c|}{$\frac{1}{t_{1/2}}\;/\;s^{-1}$} \\
\hline
\end{tabularx}
\end{table}
答え1
コメントが長すぎます...
コメントがより明確になるように、テーブル コード フラグメントをいくつかの行で拡張し、問題を示す MWE (Minimal Working Example、小さいながらも完全なドキュメント) に拡張してください。
これまでのところ、何が問題なのか推測することしかできません。コード フラグメントを使用して、考えられる 3 つの例を示します。
\documentclass{article}
\usepackage{tabularx}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\usepackage{tabularray}
\begin{document}
\begin{table}[ht]
\caption{With your code fragment}
\centering
\setlength\extrarowheight{2pt}
\begin{tabularx}{\textwidth}{|*{6}{Y|}}
\hline
Concentration of L-Ascorbic Acid in the Reaction Mixture$\;/\;\mathrm{M}$
& \multicolumn{5}{c|}{$\frac{1}{t_{1/2}}\;/\;s^{-1}$} \\
\hline
\end{tabularx}
\end{table}
\begin{table}[ht]
\caption{With your code fragment when is added an empty row}
\renewcommand\tabularxcolumn[1]{m{#1}}
\centering
\setlength\extrarowheight{2pt}
\begin{tabularx}{\textwidth}{|*{6}{Y|}}
\hline
Concentration of L-Ascorbic Acid in the Reaction Mixture$\;/\;\mathrm{M}$
& \multicolumn{5}{c|}{$\frac{1}{t_{1/2}}\;/\;s^{-1}$} \\
\hline
& & & & & \\
\hline
\end{tabularx}
\end{table}
\begin{table}[ht]
\centering
\caption{You may looking for such table}
\begin{tblr}{hlines, vlines,
colspec={l X[c, mode=dmath]},
rowsep={5pt}
}
Concentration of L-Ascorbic Acid in the Reaction Mixture/$\mathrm{M}$
& \frac{1}{t_{1/2}};s^{-1} \\
\end{tblr}
\end{table}
\end{document}
テーブルの使用に関するコンテキストを追加してください。つまり、テーブルがどのようなものであるかを明確にしてください。