設定表格中字型和單一儲存格的格式?

設定表格中字型和單一儲存格的格式?

是否可以直接修改表格中的字型?

例如我有:

\begin{tabular}{ |l|l| }
  \hline
  \multicolumn{2}{|c|}{Table of Bla } \\
  \hline
  test & test2 \\
  yes  & no    \\
  \hline
\end{tabular}

我想把標題Table of Bla加粗,可以嗎?

答案1

環境中的所有單元格tabular形成一個群組,因此在其中一個單元格中設定字體屬性不會影響其他單元格。

所以答案是

\begin{tabular}{ |l|l| }
\hline
\multicolumn{2}{|c|}{\bfseries Table of Bla} \\
\hline
test         & test2 \\
\itshape yes & no \\
\hline
\end{tabular}

我已將第三行中的第一個單元格設為斜體,只是為了顯示另一個範例。

也可以用一個

\textbf{Table of Bla}

\textit{yes}

但這只會讓 TeX 更加努力。當然,您應該使用該\textXX表格部分儲存格內容,例如

\multicolumn{2}{|c|}{\textbf{Table} of Bla} \

相關內容