Re: 表(tabular)の揃え、幅、背景色

名前: トニイ
日時: 2005-03-26 11:42:04
IPアドレス: 61.198.83.*

>>35200 ちょっと,あがいてみました。 % pLaTeX2e \documentclass[a4j,10pt]{jarticle} \usepackage[dvips]{color} \makeatletter \newcounter{OEcnt}[subsection]% カウンタ OEcnt を新たに作る \newlength{\TBLwidth}% 塗りつぶす箱の幅 \setlength{\TBLwidth}{30mm}% 15mm x 2 \addtolength{\TBLwidth}{3\tabcolsep}% カラムの空きを追加 \newcommand{\OEcolor}{% \stepcounter{OEcnt}% カウンタを一つ増やし \ifodd\c@OEcnt{% 奇数なら \fboxsep=0pt\hspace*{-\tabcolsep}% \makebox[0pt][l]{\colorbox{yellow}{% 箱で塗りつぶす \rule{\TBLwidth}{0pt}\rule[-3pt]{0pt}{13pt}}}\hfill}% %% 幅 \TBLwidth, 高さが下に 3pt(深さ)上に10pt(10-3pt) \else\fi }% \makeatother \begin{document} \subsection*{3月23日} \begin{tabular}{|r|r|} \OEcolor \makebox[15mm][c]{buy} & \makebox[15mm][c]{sell} \\ \OEcolor 30,000 & 10,000 \\ \OEcolor 5,000 & 200 \\ \OEcolor 100 & 20,000 \end{tabular} \subsection*{3月24日} \begin{tabular}{|r|r|} \OEcolor \makebox[15mm][c]{buy} & \makebox[15mm][c]{sell} \\ \OEcolor 800 & 8,000 \\ \OEcolor 300 & 2,000 \\ \OEcolor 300 & 2,000 \\ \OEcolor 100 & 200 \end{tabular} \subsection*{3月25日} \setcounter{OEcnt}{0}%% カウンタ値をリセット \begin{tabular}{|r|r|} \OEcolor \makebox[15mm][c]{buy} & \makebox[15mm][c]{sell} \\ \OEcolor 800 & 8,000 \\ \OEcolor 30,000 & 10,000 \\ \OEcolor 300 & 2,000 \end{tabular} \end{document}

この書き込みへの返事:

お名前
題名 
メッセージ(タグは <a href="...">...</a> だけ使えます)