Click here to Skip to main content
13,004,215 members (77,823 online)
Rate this:
Please Sign up or sign in to vote.
See more:
good evening friends . i am working on a page where i need to change color code of a table , i am pickiing that color code from database.
Could you please help me how can i do this
Posted 18-Apr-13 0:25am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1


Copy the table's HTML code in a string variable, then on the table background property apply the color you retrieved from database.

ex string str="
<table style="background-color:"><tr><td>hello</td></tr></table>
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

You have to use runat="server" ID = "yourTableID" to convert an HTML table into server side control. Then use the following property in the code behind:

yourTableID.BgColor = "SomeColorFromDatabase";
Member61 18-Apr-13 6:37am
Zafar Sultan 18-Apr-13 6:39am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170627.1 | Last Updated 18 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100