2012-05-06 57 views
0

我有問題,在aspx.cs CSS樣式文件C#ASP.NET CSS樣式

HttpContext.Current.Response.Write("<table class=\'bordered\' cellpadding=\'5\' color: \'red\' <tr>"); 

class=\'bordered\'cellpadding=\'5\'工作,但color: \'red\'不行,我無法找到問題,請幫助;)

回答

3

color需求style標籤內被包裹:

HttpContext.Current.Response.Write("<table class=\'bordered\' cellpadding=\'5\' style=\"color:red;\"><tr>"); 

演示:http://jsbin.com/ofapud

1

由於您使用的是雙引號,因此您不必轉義'個字符。

試試這個:HttpContext.Current.Response.Write("<table class='bordered' cellpadding='5' color: 'red' <tr>");

+0

沒有'顏色'屬性爲'

'... – EdSF

+0

你不會說! – sed

0

這應該是簡單的

Response.Write("<table class='bordered' cellpadding='5' color: 'red'> <tr>"); 
+0

'

'沒有'color'屬性... – EdSF