tex

tex で表の網掛けの仕方

投稿日:

表を見やすく網掛けする方法は、エクセルなどでよく使われる。

tex の表でもできる。

colortbl パッケージを使う。マニュアル:https://ftp.jaist.ac.jp/pub/CTAN/macros/latex/contrib/colortbl/colortbl.pdf

xcolor, colortbl パッケージを使う。

\usepackage{xcolor}
\usepackage{colortbl}

色を指定するときに、!(数字)と書いて薄い色を使うようにする。

\usepackage{xcolor}
\usepackage{colortbl}

\begin{document}

\begin{table}[h]
    \centering
    \begin{tabular}{|c|c|c|}
        \hline
	\rowcolor{red!30} 赤1 & 赤2 & 赤3 \\
	A & B & C \\	
	\hline	
    \end{tabular}
\end{table}

\begin{table}[h]
    \centering
    \begin{tabular}{|c|c|c|}
        \hline
	\rowcolor{blue!30} 青1 & 青2 & 青3 \\
	D & E & F \\
	\hline	
    \end{tabular}
\end{table}

\begin{table}[h]
    \centering
    \begin{tabular}{|c|c|c|}
        \hline
	\rowcolor{green!30} 緑1 & 緑2 & 緑3 \\
	G & H & I \\
	\hline	
    \end{tabular}
\end{table}

\end{document}

結果

-tex
-

執筆者:


comment

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

関連記事

no image

tex で表の縦横軸を調整する方法

例 \begin{center} \begin{table}[] \begin{tabular}{|c|c|c|c|} \hline 氏名 & 生年 & 没年 & 著書 …

no image

tex で傍点を使って強調する

tex で傍点を使って強調するには、一文字ずつ\. をつける。 例 \.g\.o\.o\.d 結果 このお姉さんはフィクションです!? 1巻【電子書籍】[ むつきつとむ ]価格:660円(税別、送料別 …

no image

tex で数式の場所を右揃え・左揃えにする

align 環境のもとで、& をつけると右揃えや左揃えにすることができる。改行には \\ 記号を使う。 例 \begin{align*} f(x) = x^2 + 2x + 1 &\\ …

no image

tex の equation 環境で複数行の数式を入力する(\split を使う)

\equation の中で \split を使う。 \tag を使って、自分で定義した式番号を使える。 例 \begin{equation} \begin{split} a \\ b \\ c \en …

no image

tex でまるばつを入力する方法

マル記号、バツ記号、マルの中にバツ記号をそれぞれ入力するには次のようにする。 例 $$\circ \times \otimes$$ 結果 美味しんぼ(70)【電子書籍】[ 雁屋哲 ]価格:605円(税 …