hi anyone help with an image in a table

Discussion in 'HTML & Website Design' started by harrisonford, Jun 29, 2008.

  1. #1
    im trying to get an image into the bg of this table


    i have a css file that has this bit

    #generalBox .headtd { font-family:Verdana,Tahoma,Arial; font-size:10pt; font-weight:bold; color:#FFFFFF; background-color:#003399; }

    is this an easy job?
     
    harrisonford, Jun 29, 2008 IP
  2. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Your opening table tag is not closed
    <table cellspacing="1" cellpadding="3" width="100%" border="0" >

    You have something called #generalBox in your CSS but there's no such thing in the HTML that I can see. Browsers will ignore everything in that declaration unless they see something with an id of generalBox.

    If that's going to be the id of the table, do this:
    <table cellspacing="1" cellpadding="3" width="100%" border="0" id="generalBox">

    and then get rid of
    <tr>
    <td class="headtd" colspan="2">%companyName%</td>
    </tr>
    because you are using tbody, so why not do it properly and have thead too?
    <table cellspacing="1" cellpadding="3" width="100%" border="0" id="generalBox">
    <thead>
    <tr>
    <td colspan="2">%companyName%</td>
    </tr>
    </thead>
    <tbody>
    <tr>
    ...etc...

    then
    #generalox thead td {
    font: bold 10pt Verdana, Tahoma, Arial; (10pt is pretty tiny btw)
    color:#fff;
    background: #039 url(image.gif) left top no-repeat;
    }

    or whatever for placement of the image, you can do center center.

    If company name is going to change, then you have a problem-- what if the company name is longer than the image width? You'll have to figure that one out.
     
    Stomme poes, Jun 30, 2008 IP
  3. modern_mozart101

    modern_mozart101 Peon

    Messages:
    105
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    replace <table > tag with:

    <table cellspacing="1" cellpadding="3" width="100%" border="0" background="your image">

    on my site I just do this in html
     
    modern_mozart101, Jun 30, 2008 IP