View Full Version : Background image in a table

02-15-2008, 10:11 PM
I am using this coding

<table width='100%' border='1'>

and I cannot get a background image to appear in that table. I tried the following,

img src='images/background.jpg'


and more. Can it be done without setting up a css for it?

Andrew Johnson
02-15-2008, 10:27 PM
Firstly, this doesn't belong in PHP.


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

02-15-2008, 10:33 PM
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.

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

Andrew Johnson
02-15-2008, 10:53 PM
You shouldn't throw everything in echo's...

02-15-2008, 11:49 PM
I don't use echos at all. I use $page .= "";

02-16-2008, 01:02 AM
That also sounds like a bad and wastful way to go.

02-16-2008, 03:41 AM
Are you talking about me using $page ultra?

02-16-2008, 03:47 AM
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.

02-16-2008, 05:10 AM
I use html in templates, but in the main scripts it's like this,

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.