這裏是我的問題:應用CSS樣式在創建動態表
當我在C#中創建我的表,我想不同的CSS樣式添加到每個細胞。
而(DR.Read()){
TableRow linha1 = new TableRow(); cel1 = new TableCell(); cel2 = new TableCell(); cel3 = new TableCell(); cel4 = new TableCell(); cel1.Controls.Add(new LiteralControl(DR.GetValue(0).ToString())); cel2.Controls.Add(new LiteralControl(DR.GetValue(1).ToString())); cel3.Controls.Add(new LiteralControl(DR.GetValue(2).ToString())); cel4.Controls.Add(new LiteralControl(DR.GetValue(3).ToString())); linha1.Controls.Add(cel1); linha1.Controls.Add(cel2); linha1.Controls.Add(cel3); linha1.Controls.Add(cel4); Tab_artigos_all.Controls.Add(linha1); }
不,這不是你的問題,這是你的目標。你試過什麼了?爲asp.net控件添加樣式實際上是一件微不足道的事情,由互聯網上的多篇文章所覆蓋......那麼究竟是什麼問題呢? – walther