未分類

tex 表の一部の列のみを中央揃えにする

投稿日:

中央揃えにしたい列を、c で指定すればよい。その他は l (左)または r (右)揃えに指定する

\begin{table}
\begin{tabular}{ |r|c|r|}
\hline
Taro Yamada & Jiro Tanaka & Saburo Suzuki \\
\hline
1 & 2 & 3\\
\hline
4 & 5 & 6 \\
\hline
\end{tabular}
\end{table}

結果

-未分類

執筆者:


comment

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

関連記事

no image

tex で和集合を入力する方法

\bigcup を使う。 例 $\displaystyle \bigcup _ {i \in \Lambda} A_i $ 結果

no image

tex で行に色をつける方法

xcolor パッケージを使っておく。rowcolor で指定する。 例 \usepackage[table]{xcolor} \begin{document} \begin{table} \begi …

no image

python3 でカンマの入った数値の文字列を数値に変換する方法

replace と int 変換を組み合わせる。 例 str1 = ‘1,234,567’ int1 = int(str1.replace(‘,’,”)) print(int1) 結果 123456 …

no image

matplotlib で x, y軸・タイトルのフォントサイズを調整する

ラベルの fontsize で指定する。 例 import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 2, 100) …

no image

c++ で文字列を「区切り文字」を使って分ける方法

string の find を使って、区切り文字の場所を取得し、その位置で区切る。 例 #include <iostream> #include <string> using namesp …