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 で式番号を自分で指定する方法

amsmath パッケージを使っておき、\begin{equation} と \end{equation} の数式中で \tag を使うと式番号を自分で指定したとおりに表示できる。(式番号の中に日本語 …

no image

tex でチェックマークとバツ記号を入力する方法

amssymb パッケージを導入して、\checkmark でチェックマークが入力できる。 例 \usepackage{amssymb} \begin{document} $\checkmark \t …

no image

tex で無限の記号を入力する

「無限大」を表す記号を入力するには、\inftyを使う。 例 $$\infty , -infty$$ 結果

no image

tex でニアリーイコール記号を入力する

ニアリーイコール記号を入力するには、\fallingdotseq または、\rigingdotseq を使う。 例 \usepackage{amssymb} \begin{document} $$x …

no image

tex で上極限・下極限の記号を入力する

\amsmath パッケージを使い、\varlimsup, \varliminf を使う。 例 \usepackage{amsmath} \usepackage{amssymb} \begin{doc …