Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8270241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:31:32+00:00 2026-06-08T06:31:32+00:00

I have some HTML that I am rendering out to a PDF file with

  • 0

I have some HTML that I am rendering out to a PDF file with iTextSharp. However, I’m having some issues with setting the background colors of my table cells. Here is some sample HTML I am using:

<tr align="center">
<th width="16%" colspan="2" style="height: 16px; font-weight:bold;" color="#FF0000">Test Colored Text</th>
<td width="28%" colspan="2" style="height: 16px;"><asp:Literal runat="server" ID="litData" /></td>
</tr>

The <th> element in this case has some properties being set via the style property. In this case height and font-weight. Also, I have a color property being set on this as well.

This outputs a table to my PDF file where the “Test Colored Text” text is set to Red as per the color property. My goal is to set the background color of this cell, and have tried adding the css property background-color to the style tag with no luck.

Being that the color property is being read I tried a few other properties to see if any would take:
background-color,
backgroundcolor,
basecolor

However, none of these effectively change the background color of the cell in the PDF file.

My question is, what is the property name that it is looking for to set the background color? I’ve looked around a bit and have only found ways where people do this buy building the cells in the code, which for me is not an option as I am stuck with this HTML that needs to be styled.

Edit: Using the bgcolor property sets the background of the cell. Thanks Louis!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T06:31:34+00:00Added an answer on June 8, 2026 at 6:31 am

    Try using the bgcolor attribute.

    <th  bgcolor="#FFFF00" color="#FF0000">Test Colored Text</th>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some HTML that is being produced by a WordPress plugin that is
I have some HTML that I need to toggle between two structures - one
I have some HTML that looks like this: <div> <div class=value> <a href=# class=clicker>Some
I have some HTML that is stored as an attribute on a tag. I
I have some HTML that looks like this: <div class=product> Content In Here <div
If I have some HTML that looks like this: <div id=text> This is some
So I have some html that looks like the following: <div class='something unknown' id='something_unknown_1'>
I have some html files that I want to convert to text. I have
I have some html stored in database . I dont know that html stored
I have some html returned from an ajax call that contains blocks of html.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.