locked
change the font color of a HtmlTableCell RRS feed

  • Question

  • I wan to change the color of a HtmlTableCell , 
    I searched and I found this 
    cell.Style.Add(HtmlTextWriterStyle.Color, "#9d0e2d")

    cell.Style.Add(HtmlTextWriterStyle.Color, "White")

    but both do not work for me

    although , i used title.Style.Add(HtmlTextWriterStyle.BackgroundColor, "White") and it works well

     

    any help please

    Wednesday, August 24, 2011 2:00 PM

Answers

  • Hello AmmatAllah

    Please check this code

    <table  >

        <tr><td id="tdFontColor" runat="server">Hello World</td></tr>

        </table>

    On your code behind

     

    protected void Page_Load(object sender, EventArgs e)

        {

            tdFontColor.Attributes.Add("style", "color:Green");

          

        }

     


    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    • Marked as answer by Jackie-Sun Wednesday, August 31, 2011 9:45 AM
    Thursday, August 25, 2011 5:12 AM

All replies

  • Thursday, August 25, 2011 3:15 AM
  • Thursday, August 25, 2011 3:47 AM
  • Hello AmmatAllah

    Please check this code

    <table  >

        <tr><td id="tdFontColor" runat="server">Hello World</td></tr>

        </table>

    On your code behind

     

    protected void Page_Load(object sender, EventArgs e)

        {

            tdFontColor.Attributes.Add("style", "color:Green");

          

        }

     


    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    • Marked as answer by Jackie-Sun Wednesday, August 31, 2011 9:45 AM
    Thursday, August 25, 2011 5:12 AM