LoginSignup
0
0

More than 5 years have passed since last update.

MT: 奇数行/偶数行で背景色を変える方法

Posted at

MTで、表の1行ごとに背景色を変えたいような場合の手法

1行1エントリーなら変数 __odd__, __even__を使う
MTFor, MTLoop, MTEntries, MTPages など、ループ処理を行うブロックタグ内で利用可能。

<mt:Entries lastn="10">
<mt:EntriesHeader>
<table>
</mt:EntriesHeader>

    <tr class="<mt:If name="__odd__">odd<mt:Else>even</mt:If>">
        <td>foo</td>
        <td>bar</td>
    </tr>

<mt:EntriesFooter>
<table>
</mt:EntriesFooter>
</mt:Entries>

ブロックタグに利用できる予約変数
http://www.movabletype.jp/documentation/mt5/design/templates/loopvariable.html

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0