By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,053 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,053 IT Pros & Developers. It's quick & easy.

Div being ignored

P: n/a
Hi,

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
query.");
echo "<table class=efitable>";
echo "<caption align =left class=caption><b>Element Further
Information</b></caption>";
echo "<tr><td class=td>Description</td><td class=td>Amount</td></tr>\n";
while ($myrow = mysql_fetch_row($sql_result)) {
printf("<tr><td>$myrow[0]</td><td>$myrow[1]</td></tr>\n");
}
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

Rega
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Mon, 12 Jul 2004 22:09:48 GMT, Rigga <ri***@hasnomail.com> wrote:
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.
PHP will completely ignore the contents of your HTML, it's none of its
business. Its up to the browser to interpret it.
/* Print Information table */
echo "<div class='colourbackground'>";
Are you sure there's a class of that name and that it's valid CSS?
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


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

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
Jul 17 '05 #2

P: n/a
Andy Hassall wrote:
On Mon, 12 Jul 2004 22:09:48 GMT, Rigga <ri***@hasnomail.com> wrote:
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.


PHP will completely ignore the contents of your HTML, it's none of its
business. Its up to the browser to interpret it.
/* Print Information table */
echo "<div class='colourbackground'>";


Are you sure there's a class of that name and that it's valid CSS?
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


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

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space

Yes I am sure there is a valid class. Thanks for helping I will repost in
html group.

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.