R
Rigga
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 underneath 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 have checked my CSS and can find no problems there, heres hoping someone
here can help.
Many thanks
Rega
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 underneath 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 have checked my CSS and can find no problems there, heres hoping someone
here can help.
Many thanks
Rega