Jump to content

CSS Table th background


Aaron

Recommended Posts

I want a background to go across my whole header, but there are multiple th's. I noticed there's a thead, is there any way I can make an image in the thead? The height is set right for the image, but the width is gonna be 100% of the width of the header (it will change)

Link to comment
Share on other sites

  • Administrators

Use colspan to span all the columns you want it to cover in the table.

<th colspan="HOWMANY"><img src="my image link" alt="TEXT DESCRIPTION" /></th>

or if you are doing it in CSS assign a class to it and use the background function

<th class="background" colspan="HOWMANY"><th>

css

th.background  {
 background: #000;
 height: 100px;
etc....
}

Link to comment
Share on other sites

simpilot, that will just repeat the image accross all <th>'s. You can only really put a solid color as a bg in a certain area of a table. Unless you create an image that is the exact width of your table, and align it with the top of the table, and make the bottom part of the image the same color as the bg of the page, or what ever is the color of the bg of the table. You would have to set that to the background of the entire table, not just the <th>'s

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...