Div being ignored

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have created a page that builds up a table using data from a database and
formats the table using css tags.  I want to draw a coloured background
around my table (or just a portion of the scren that the table 'sits' on)
however when I isue the <div class="myclass"> in the php script it just
appears to ignore it.  I have included a snippet of my code below as this
will make it clearer:

All standard htm code at top of page, it then gets to the part where it
draws the table:

/* Print  Information table */
echo "<div class='colourbackground'>";
$sql = "SELECT * FROM ElementFurtherInformation WHERE
DATE_FORMAT(PaymentDate,'%d %b %Y')  =  '$pdate'";
$sql_result = mysql_query($sql,$connection) or die("Couldn't execute
echo "<table class=efitable>";
echo "<caption align =left class=caption><b>Element Further
echo "<tr><td class=td>Description</td><td class=td>Amount</td></tr>\n";
while ($myrow = mysql_fetch_row($sql_result)) {
echo "</table>\n";
echo "</div>\n";

Standard closing tags etc after...

The table is formatted with a border and a background colour however the div
should also draw a background colour inderneath the table so any parts that
are normally white should be the colour specified in my css file but it
just appears to ignore it.

I am new to php and web design, not sure if I should ave posted it here or a
generic html group, heres hoping someone here can help.

Many thanks


Re: Div being ignored

Quoted text here. Click to load it

 PHP will completely ignore the contents of your HTML, it's none of its
business. Its up to the browser to interpret it.

Quoted text here. Click to load it

 Are you sure there's a class of that name and that it's valid CSS?

Quoted text here. Click to load it

 Yes, it's an HTML (or maybe CSS) question not a PHP one.

http://www.andyh.co.uk          / http://www.andyhsoftware.co.uk/space

Re: Div being ignored

Andy Hassall wrote:

Quoted text here. Click to load it
Yes I am sure there is a valid class.  Thanks for helping I will repost in
html group.

Site Timeline