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 1078833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:46:55+00:00 2026-05-16T21:46:55+00:00

We need to set background image of a table. One way is to set

  • 0

We need to set background image of a table. One way is to set the background attribute of table tag but this needs to enable printbackground option in the browser when printing.
Any other way out like we can set z-index of image and table?

  • 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-05-16T21:46:55+00:00Added an answer on May 16, 2026 at 9:46 pm

    This is really a CSS quetion.
    z-index only takes affect when objects are positioned absolutely. It is used to manually set the order in which elements appear on top of one another. If a HTML element appears after another, by default it will appear on top of the other, and you can use z-index to override this default.

    <img src="some image"/>
    <div>some text</div>
    
    <style type="text/css">
    img, div {
        position: absolute;
    }
    </style>
    

    In the above html, the div will appear on top, and z-index could be used to change this.

    What you’re trying to achieve display a background image for a table, including when it’s being printed – am I correct? Your problem is that by default most browsers don’t print background-images (to save on ink and to make things easier to read). You can usually choose to print with background images on in your browser settings if you wish, so perhaps you don’t need to force this on your site, instead just note to the users to turn on background-images in their print settings?

    But if you do indeed want to force users to print the background image, your code may look something like this:

    <img class="table-bg-image" src="http://www.google.com.au/intl/en_com/images/srpr/logo1w.png"/>
    <table class="with-bg-image">
        <tr><td>Table contents here</td></tr>
    </table>
    
    <style type="text/css">
        img.table-bg-image {
            position: absolute;
            z-index: -1;
        }
        table.with-bg-image, table.with-bg-image tr, table.with-bg-image td {
            background: transparent;
        }
    </style>
    

    Remember to compare the image size to the size of the table.

    Positioning the image absolutely will cause it to ‘float’ under the table, because when you don’t set ‘top’ and ‘bottom’ attributes absolute positioning doesn’t change an elements position (it only means that it doesn’t take up any room). The fact that the element is absolutely positioned is causing it to display above the table by default, so we use a negative z-index to make it appear behind.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to set up this scenario: A SQL Server 2005 database will create
I need to set the height of every textbox on my form, some of
I need to set the text within a DIV element dynamically. What is the
I need to set up an instance of SQL Server 2005 with SQL_Latin1_General_CP850_Bin as
I need to set a dependency property on a control (Slider.Value) in my code
We need to set up a secure certificate on an Apache reverse proxy. We've
I need to set an environment variable in Python and find the address in
I need to set the fetch mode on my hibernate mappings to be eager
I need to set a system environment variable from a Bash script that would
I need to set up some RewriteRules to redirect a URL which has a

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.