Div being ignored

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rigga

    Div being ignored

    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='colourba ckground'>";
    $sql = "SELECT * FROM ElementFurtherI nformation WHERE
    DATE_FORMAT(Pay mentDate,'%d %b %Y') = '$pdate'";
    $sql_result = mysql_query($sq l,$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>Descri ption</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
  • Andy Hassall

    #2
    Re: Div being ignored

    On Mon, 12 Jul 2004 22:09:48 GMT, Rigga <rigga@hasnomai l.com> wrote:
    [color=blue]
    >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.[/color]

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

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

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

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

    Comment

    • Rigga

      #3
      Re: Div being ignored

      Andy Hassall wrote:
      [color=blue]
      > On Mon, 12 Jul 2004 22:09:48 GMT, Rigga <rigga@hasnomai l.com> wrote:
      >[color=green]
      >>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.[/color]
      >
      > PHP will completely ignore the contents of your HTML, it's none of its
      > business. Its up to the browser to interpret it.
      >[color=green]
      >>/* Print Information table */
      >>echo "<div class='colourba ckground'>";[/color]
      >
      > Are you sure there's a class of that name and that it's valid CSS?
      >[color=green]
      >>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[/color]
      >
      > Yes, it's an HTML (or maybe CSS) question not a PHP one.
      >
      > --
      > Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
      > http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space[/color]
      Yes I am sure there is a valid class. Thanks for helping I will repost in
      html group.

      Comment

      Working...