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 で米印(アスタリスク)を入力する方法

アスタリスクは、「*」記号で入力できる。tex の数式モードと、数式モードの外で書き方が異なるので注意。 例 数式モードの中:math mode $x^{*} A* B^{**}$数式モードの外:te …

no image

tex の equation で式番号を表示しないようにする方法

\nonumber を使うと式番号を表示しないようにできる。 例 \usepackage{amsmath} \begin{document} \begin{equation} \nonumber y …

no image

tex で円周率(π)を表示する方法

tex でπを表示する方法 例 $\pi$ 結果 リベンジH 4【電子書籍】[ 仙道ますみ ]価格:660円(税別、送料別)(2020/12/27時点)楽天で購入

no image

tex で絶対値記号やノルムの縦棒を長くする方法

ノルムの絶対値記号を単純に入力しただけでは短くて困ることがあるので、長くしたいときがある。 \amsmath パッケージで、 \lVert や \rVert, \lvert や \rvert&nbsp …

no image

tex でπ積(総乗、乗積)を表示する方法

tex で大文字のπ(Π)を使って乗積を表示する方法 例 $\displaystyle \prod_{i=0}^{N} a_i$または$\prod_{i=0}^{N} a_i$ 結果 このお姉さんはフ …