Results 1 to 15 of 15

 

Thread: re-size table background image

  1. #1
    Super Member

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Costa Del Sheffield
    Posts
    2,838
    Thanks
    5
    Thanked 18 Times in 14 Posts


    is there an easy way to resize a background image?

    so I have something like this...

    <table width="100" border="0" cellpadding="0" cellspacing="0" background="../images/image1.jpg">

    Now say image1.jpg is actually 400px wide, all I can see i nthe table above is the top left hand corner of it. Is there an easy way to get the table to lad the image as a 100x100 image as the background?

    Cant think of a way, without going through and resizing all the images, hopeful for ideas though
    Dan Morley
    alpharooms.com
    daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
    My Blog | Cheap Holidays

  2. #2
    Registered User

    Status
    Offline
    Join Date
    Oct 2005
    Posts
    426
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not sure what you are trying to do.

    As it reads... you want to use a 400 px wide image for a 100 px wide table.
    Is this correct?
    Travel Domains for sale: luxuryhotelparis.co.uk italytravelguide.co.uk bettertravel.co.uk america-flights.co.uk bargainairline.co.uk costaricahotel.co.uk hotelsintallinn.co.uk
    Pm me for prices.

  3. #3
    Super Member

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Costa Del Sheffield
    Posts
    2,838
    Thanks
    5
    Thanked 18 Times in 14 Posts
    only as the background though, whats actually i nthe table is something completely different.

    a bit like...

    <table width="100" border="0" cellpadding="0" cellspacing="0" background="image1.jpg"><tr>
    <td>blah blah table content not the background image</td>
    </tr></table>

    if it was just the odd image or so id resize them, but its a few thousand and I really cant be bothered... if I just had the image in the table I could set the width to 100 and that would be fine, but its the background
    Dan Morley
    alpharooms.com
    daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
    My Blog | Cheap Holidays

  4. #4
    Registered User

    Status
    Offline
    Join Date
    Oct 2005
    Posts
    426
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Still not sure if I'm reading your post properly

    But anyway... say your image is 400 x 100 px's.
    Using it as the background image will fill your 100 px wide table.
    If your table was 600 px's high... the image would repeat to fill.

    Mind...you may be better to use css.

    Hope this helps
    Travel Domains for sale: luxuryhotelparis.co.uk italytravelguide.co.uk bettertravel.co.uk america-flights.co.uk bargainairline.co.uk costaricahotel.co.uk hotelsintallinn.co.uk
    Pm me for prices.

  5. #5
    Super Member

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Costa Del Sheffield
    Posts
    2,838
    Thanks
    5
    Thanked 18 Times in 14 Posts
    seems my explaining sucks

    image is say 400x400. If i stick it as the background of a 100x100 table yeah it fills it, but it only fills it using the 100x100 top left hand squae of the main picture.

    if the background image was 100x100 it would fill perfect, but its too bit just want to know if I can resize it without actually going through and resizing it, ie just set the width of it.

    the more i think about it the more im convincing myself its impossible, shame
    Dan Morley
    alpharooms.com
    daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
    My Blog | Cheap Holidays

  6. #6
    Registered User

    Status
    Offline
    Join Date
    Oct 2005
    Posts
    426
    Thanks
    0
    Thanked 0 Times in 0 Posts
    pm the bloody code and the picture
    Travel Domains for sale: luxuryhotelparis.co.uk italytravelguide.co.uk bettertravel.co.uk america-flights.co.uk bargainairline.co.uk costaricahotel.co.uk hotelsintallinn.co.uk
    Pm me for prices.

  7. #7
    Super Member

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Costa Del Sheffield
    Posts
    2,838
    Thanks
    5
    Thanked 18 Times in 14 Posts
    haha I can post an example, ill use an image from alpha, as im all secrative liek that

    open up notepad or something and paste this in:

    <table width="100" border="0" cellpadding="0" cellspacing="0" background="http://www.uni-graz.at/~katzer/pictures/citr_44.jpg"><tr>
    <td>blah blah table content not the background image</td>
    </tr></table>

    the image is nabbed from G images but anything bigger than 100 wide would have done.

    see the table will show the image but only fro mthe top left corner.

    Idealy id want it so that the image looked like...

    <img src="http://www.uni-graz.at/~katzer/pictures/citr_44.jpg" width="100">

    So that you can tell what it is.
    Dan Morley
    alpharooms.com
    daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
    My Blog | Cheap Holidays

  8. #8
    Registered User

    Status
    Offline
    Join Date
    Oct 2005
    Posts
    426
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK... now I think I see it... wait a mo
    Travel Domains for sale: luxuryhotelparis.co.uk italytravelguide.co.uk bettertravel.co.uk america-flights.co.uk bargainairline.co.uk costaricahotel.co.uk hotelsintallinn.co.uk
    Pm me for prices.

  9. #9
    Registered User

    Status
    Offline
    Join Date
    Oct 2005
    Posts
    426
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <div style="width:100px; position:absolute; left:0px; top:0px; text-align:center;">
    <img src="/images/citr_44.jpg" style="width:100px; height:100px;">
    </div>

    Try that
    Last edited by Nosmo_King; 11-07-06 at 12:38 AM.
    Travel Domains for sale: luxuryhotelparis.co.uk italytravelguide.co.uk bettertravel.co.uk america-flights.co.uk bargainairline.co.uk costaricahotel.co.uk hotelsintallinn.co.uk
    Pm me for prices.

  10. #10
    Super Member

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Costa Del Sheffield
    Posts
    2,838
    Thanks
    5
    Thanked 18 Times in 14 Posts
    nada, that just displays the image? It needs to be as a background as I have other stuff to go over the top.

    Nothings making sense anymore think I needs some sleep! Thanks anyway though!
    Dan Morley
    alpharooms.com
    daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
    My Blog | Cheap Holidays

  11. #11
    Registered User

    Status
    Offline
    Join Date
    Oct 2005
    Posts
    426
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry...think I need sleep as well.

    I forgot to mention... I think the only way you'll be able to do this is with a div over the top over a div. Obviously change the divs to suit.
    Last edited by Nosmo_King; 11-07-06 at 12:39 AM.
    Travel Domains for sale: luxuryhotelparis.co.uk italytravelguide.co.uk bettertravel.co.uk america-flights.co.uk bargainairline.co.uk costaricahotel.co.uk hotelsintallinn.co.uk
    Pm me for prices.

  12. #12
    Registered User

    Status
    Offline
    Join Date
    Sep 2003
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Couldn't you use a script (aspx, php, etc) to resize the background image on the fly?

    Just specify the script file as the background image, perhaps with the original image file name and it's new size specified on the querystring.
    Prezzybox.com home of the gift wizard

  13. #13
    n00b1e and lovin' it

    Status
    Offline
    Join Date
    May 2006
    Posts
    40
    Thanks
    3
    Thanked 0 Times in 0 Posts
    <table width="100" height"100" border="1" cellspacing="0" cellpadding="0" style="background: url(images/&image.jpg);width:400px;height:400px;background-repeat:no-repeat;zoom:25%;">

    Is that any use?

  14. #14
    Registered User

    Status
    Offline
    Join Date
    Mar 2004
    Location
    Stafford, UK
    Posts
    323
    Thanks
    1
    Thanked 4 Times in 2 Posts
    Hi Dan,

    Just had a quick hack-around and it looks like you can do it using CSS and z-indexing to layer the image (resized as required) behind the table. This works as long as both image and table are enclosed within a container DIV, and both styled with "position: absolute;". Here's my test page (note that TD is styled to have white text so that it shows up over the background image!):

    HTML Code:
    <html>
      <head>
        <style type='text/css'>
        #myImage {
          position: absolute;
          z-index: 1;
        }
    
        #myTable {
          position: absolute;
          z-index: 2;
        }
    
        td {
          color: white;
          text-align: center;
          font-weight: bold;
        }
        </style>
      </head>
      <body>
        <h1>Resized Background Image Test</h1>
        <div>
          <img id='myImage' width='100' src='img.jpg' />
          <table id='myTable' width='100' cellpadding='0' cellspacing='0'>
            <tr>
              <td>1</td>
              <td>2</td>
            </tr>
          </table>
        </div>
      <body>
    </html>
    You might want to think about how this will appear in older browsers that do not support CSS & z-index, but depending upon what else you are doing this may not be an issue
    Developer of the Price Tapestry Price Comparison Script now with full WordPress Plugin!

  15. #15
    Super Member

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Costa Del Sheffield
    Posts
    2,838
    Thanks
    5
    Thanked 18 Times in 14 Posts
    cheers dmorison

    ta everyone for ideas, had thought of some but for various reaosn wanted to do it like this
    Dan Morley
    alpharooms.com
    daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
    My Blog | Cheap Holidays



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Image URL's in datafeeds
    By B1gJo3 in forum Affiliate Marketing Lounge
    Replies: 12
    Last Post: 14-10-07, 05:45 PM
  2. Background image stretch?
    By brussell78 in forum Programming
    Replies: 4
    Last Post: 17-02-06, 01:09 PM
  3. Preferred Image Size
    By Graham@Buyagift in forum Affiliate Marketing Lounge
    Replies: 4
    Last Post: 29-06-04, 05:28 PM
  4. Mobile Phone Program Help - Image size?
    By Malcolm Cowley in forum Affiliate Marketing Lounge
    Replies: 6
    Last Post: 24-06-04, 04:32 PM
  5. Replies: 10
    Last Post: 30-03-04, 07:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2