2010-07-21 89 views

回答

2

你不能用css做到這一點。表格很難風格化(technical explanation from Eric Meyer)。

但是,您可以使用javascript將圖像完全替換爲複選框,但仍然保留常規復選框元素的表單編碼。 Here's an example using jquery

+0

有意思,沒有其他解決方法?而不是js爲此 – vondip 2010-07-21 18:07:19

+0

您的第二個鏈接不再有效。 – Blazemonger 2012-05-18 16:54:44

+0

我將鏈接更改爲更好更現代的示例。謝謝 – 2012-05-21 16:24:37

1
Public Sub SetColor() 
    Try 
     For i As Integer = 0 To gvMaster.Rows.Count - 1 
      FN = gvMaster.Rows(i).Cells(3).Text 
      If FN = "Present" Then 
       gvMaster.Rows(i).Cells(3).ForeColor = Color.Green 
      End If 
      If FN = "Absent" Then 
       gvMaster.Rows(i).Cells(3).ForeColor = Color.Red 
      End If 

      AN = gvMaster.Rows(i).Cells(4).Text 
      If AN = "Present" Then 
       gvMaster.Rows(i).Cells(4).ForeColor = Color.Green 
      End If 
      If AN = "Absent" Then 
       gvMaster.Rows(i).Cells(4).ForeColor = Color.Red 
      End If 
     Next 
    Catch generatedExceptionName As Exception 
    End Try 
End Sub 
相關問題