セルの中の繰り返される文字の色を変える
土曜を青、日曜を赤に
ruby
1 <table class = "table-bordered table-striped table-condensed"> 2 <thead> 3 <tr> <!--rowspan:縦結合、colspan:横結合--> 4 <th rowspan = "2">日付</th> 5 <th rowspan = "2">曜日</th> 6 <th colspan = "3">出社</th> 7 <th colspan = "3">退社</th> 8 <th rowspan = "2">在社時間</th> 9 <th rowspan = "2">備考</th> 10 </tr> 11 <tr> 12 <th>時</th> 13 <th>分</th> 14 <th></th> 15 <th>時</th> 16 <th>分</th> 17 <th></th> 18 </tr> 19 </thead> 20 <tbody> 21 <% @dates.each do |day| %> 22 <tr> 23 <td><%= day.worked_on.to_s(:date) %></td> 24 <td><%= %w{日 月 火 水 木 金 土}[day.worked_on.wday] %></td>
えーと、なにをききたいのかはっきりしませんが、色を指定するタグがなにかわからないうというはなしでしょうか?
失礼しました
ifで指定できるかな?と思い、まずは土曜だけ
以下のようなコードを書きましたが
コードがまちがっているのか、色は変わりませんでした
<td><% if table = "2">土< %></td>
<td><%= font color="# 0000ff">土< %></font></td>
ifで色を指定する場合、どのようにコードを書いたら良いのか?
また、他に色を指定する方法があれば教えていただきたいです‼
その質問内容を、質問を編集し追記しましょう
現状ではなにを聞きたいのかさっぱりわかりませんぜ
回答2件
あなたの回答
tips
プレビュー