0

I have problem with css styles in aspx.cs file

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

class=\'bordered\' and cellpadding=\'5\' work but color: \'red\' not work, I can't find problem please help ;)

3 Answers 3

3

color needs to be wrapped inside the style tag:

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

Demo: http://jsbin.com/ofapud

Sign up to request clarification or add additional context in comments.

Comments

1

You don't have to escape ' characters since you are using double-quotes.

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

Comments

0

This should be simple

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.