2010-11-05 68 views
0

修改單元格屬性我試圖使用嵌套在單元格中的簡單表在我的選舉結果頁面上顯示圖形。使用字段從模型

<td> 
    <%: result.candidateName %> 
    <table style="border:0; padding:2px;"> 
     <tr> 
      <td style="width:50px; border:0; height:15px; color:Blue; padding:0; font-size:75%;"><%: result.percentWon %>%</td> 
      <td style="background-color:Blue; width:400px; border:0; height:15px;"></td> 
     </tr> 
    </table> 
</td> 

我需要做的是更改單元格樣式(現在設置爲400像素)的寬度數字爲4 * result.percentWon,但我不能想出如何把鱷魚沉重標籤的中間樣式字符串。

是的,我是一個小白(O:任何人都可以學我

+0

_Alligator_標籤 – SLaks 2010-11-05 20:11:39

回答

0

你可以把在那裏,你永遠要<%: ... %>

<td style="background-color:Blue; width:<%:4*result.percentWon%>px; border:0; height:15px;"></td> 
+0

熱diggidy該死的智能感知沒有。工作,但它建立輝煌。Thnaks – Juspar 2010-11-05 20:34:08

+0

@Juspar:這是編輯器已知的問題;它不能處理深嵌套智能感知上下文。 – SLaks 2010-11-05 20:49:53