SitePoint Sponsor

User Tag List

Results 1 to 12 of 12

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    background in a cell

    Hi all

    I have a background in a cell, but it keeps repeating..how can I stop this from happening?

  2. #2
    :) delemtri's Avatar
    Join Date
    Jun 2001
    Posts
    579
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There was a post on this previously. Try:

    <td background="background" style="background-repeat:no-repeat">

    That should work.

  3. #3
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You cannot reliably stop tiling from happening. The best thing to do would be to create your image so that when it does tile it is not noticeable.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  4. #4
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    Madison, Wisconsin
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Instead of using a combination of html attributes and css, try using just the css.

    <td style="background-image: url('myimage.gif'); background-repeat: no-repeat">

    background-image is very widely supported on CSS browsers, as is background-repeat: no-repeat

  5. #5
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    create the graphic to be as big as the cell will be. I do all my backgrounds this way. The negative part is that on really big graphics, image size can get quite large. Still working through this myself, though...

    Sketch
    Aaron Brazell
    Technosailor



  6. #6
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Sketch
    create the graphic to be as big as the cell will be. I do all my backgrounds this way. The negative part is that on really big graphics, image size can get quite large. Still working through this myself, though...

    Sketch
    wouldn't this cause a problem if the cell or table are set to 100% width. how would you know how big the graphics are on other computers.

  7. #7
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah, it could. guess it depends on what the graphic is. I usually design my page backgrounds to fit at 1200x1024. Also, scripting could be used to determine display size and based on display size, have the bg set at diff sizes.

    Sketch
    Aaron Brazell
    Technosailor



  8. #8
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're hellbent on using liquid tables (i.e. percentages), use them on an outside table. Then, within that, use another table, only this time make it absolute by using pixels, the exact same dimensions as the image. That will stop your cross-browser/resolution compatibility problem while still giving you the background effect you're looking for. =)
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  9. #9
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Doug Baker
    <td style="background-image: url('myimage.gif'); background-repeat: no-repeat">
    never use single quotes in your background-image : url('') code!
    It will not work in macintosh ie browsers. neither is it of standards with w3c.
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  10. #10
    SitePoint Addict
    Join Date
    Apr 2001
    Location
    Nottingham, England.
    Posts
    209
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Odd I don't even use the quotation marks. It works fine in NN and IE. Is it even compliant?
    Absence of evidence is not evidence of absence.

  11. #11
    SitePoint Enthusiast subBlue's Avatar
    Join Date
    Jun 2001
    Location
    Edinburgh, UK
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is a bug with netscape when you apply an image as a table background - it will be repeated in each table cell, rather than over the whole table.
    The trick to get it to work in Netscape as well as IE is to make a one cell table with the background image, then within that table make your many cell table, *but* put a 1x1 transparent gif image as the background image of the nested table. It's a strange work around, but it will then display correctly.

    Here's some example code:

    Code:
    <table width="200" background="background.jpg">
      <tr>
    	<td>
    	  <table width="200" background="invisible.gif">
    		<tr>
    		  <td>Cell1</td>
    		  <td>Cell2</td>
    		</tr>
    		<tr>
    		  <td>Cell3</td>
    		  <td>Cell4</td>
    		</tr>
    	  </table>
    	</td>
      </tr>
    </table>
    Become Interactive because its all gone a bit subBlue

  12. #12
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by paroxysm
    Odd I don't even use the quotation marks. It works fine in NN and IE. Is it even compliant?
    huh? lol
    no quotations is the right way to go.
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein


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
  •