Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts

    Background image in a table

    I am using this coding

    Code:
    <table width='100%' border='1'>
    and I cannot get a background image to appear in that table. I tried the following,

    Code:
    img src='images/background.jpg'
    
    style='background-image'images/grassfield.jpg'
    and more. Can it be done without setting up a css for it?

  • #2
    Banned
    Join Date
    Feb 2008
    Location
    Winnipeg, Canada
    Posts
    396
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Firstly, this doesn't belong in PHP.

    Secondly:
    Code:
    <table style="background-image:url('images/grassfield.jpg')">

  • #3
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    Well all my coding is php and coded in php. If I asked for help in html they would give me html codes which would mess things up.

    Thanks for the coding but for php it had to be editted to this to work.

    Code:
    <table style=\"background-image:url('images/grassfield.jpg')\">
    Last edited by masterofollies; 02-15-2008 at 10:40 PM. Reason: new

  • #4
    Banned
    Join Date
    Feb 2008
    Location
    Winnipeg, Canada
    Posts
    396
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You shouldn't throw everything in echo's...

  • #5
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    I don't use echos at all. I use $page .= "";

  • #6
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts
    That also sounds like a bad and wastful way to go.
    If I'm postin here, I NEED YOUR HELP!!

  • #7
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    Are you talking about me using $page ultra?

  • #8
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts
    If you are surrounding every line of HTML with $page.="" and then echoing $page at the end, then yes. Hopfully you are doing more than that. I'd have to see it.
    If I'm postin here, I NEED YOUR HELP!!

  • #9
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    I use html in templates, but in the main scripts it's like this,

    Code:
    if ($something == "1") 
    {
    $page .= "Yes that is correct";
    }
    
    else {
    $page .= "No that isn't correct";
    }
    If I use the template opening and ending code, I can code the entire script in straight html.


  •  

    Posting Permissions

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