Div being ignored

Discussion in 'HTML' started by Rigga, Jul 13, 2004.

  1. Rigga

    Rigga Guest

    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
    Rigga, Jul 13, 2004
    #1
    1. Advertising

  2. Rigga

    rf Guest

    "Rigga" <> wrote in message
    news:e0LIc.19636877$...
    > Hi,
    >
    > I have created a page that builds up a table using data from a database

    and
    > formats the table using css tags.


    CSS rules and properties.

    > I have checked my CSS and can find no problems there, heres hoping someone
    > here can help.


    I'll bet that is where the problem is. Post the contents of your CSS file.
    Better yet, post the URL of the page (not the PHP).

    --
    Cheers
    Richard.
    rf, Jul 13, 2004
    #2
    1. Advertising

  3. Rigga wrote:

    > I have checked my CSS and can find no problems there


    Most likely the problem is in the CSS (although the HTML is relevent). Its
    much more likely that people could help if you provided a URI where the
    code could be seen in context. (For rendering issues the PHP source is
    entirely irrelevant, its the generated HTML and the CSS that count here)

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Jul 13, 2004
    #3
  4. Rigga

    Rigga Guest

    David Dorward wrote:

    > Rigga wrote:
    >
    >> I have checked my CSS and can find no problems there

    >
    > Most likely the problem is in the CSS (although the HTML is relevent). Its
    > much more likely that people could help if you provided a URI where the
    > code could be seen in context. (For rendering issues the PHP source is
    > entirely irrelevant, its the generated HTML and the CSS that count here)
    >

    Ok sorry, the page isnt 'live' yet so unable to provide you with a url,
    however the CSS file contains this:

    .colorbackground {
    font-family: arial, helvetica, sans-serif;
    margin: 0px 100px 0px 100px;
    background-color: #ffdb43;
    }

    Ive tried applying other CSS styles I have used in the past that color the
    background however it does not appear to take effect, I was wondering if it
    is not even possible to have a table over a colored square and have the
    table itself have colors in. If this doesnt make sense I will post the
    html source

    Thanks for your help
    Rigga, Jul 13, 2004
    #4
  5. Rigga

    Mark Parnell Guest

    On Tue, 13 Jul 2004 06:26:01 GMT, Rigga <> declared
    in alt.html:

    > .colorbackground {


    From your original post:

    > <div class='colourbackground'>


    Notice a difference?

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
    "Never drink rum&coke whilst reading usenet" - rf 2004
    Mark Parnell, Jul 13, 2004
    #5
  6. Rigga

    rf Guest

    Rigga wrote
    > David Dorward wrote:
    > > Rigga wrote:


    > Ok sorry, the page isnt 'live' yet so unable to provide you with a url,
    > however the CSS file contains this:
    >
    > .colorbackground {
    > font-family: arial, helvetica, sans-serif;
    > margin: 0px 100px 0px 100px;


    I suspect you mean padding. Margin is "outside" the div, padding is
    "inside".

    > background-color: #ffdb43;
    > }


    It would be handy to see the CSS for the table as well. If you want the
    div's background to show through then you might need to specify a
    transparent background for the table.

    --
    Cheers
    Richard.
    rf, Jul 13, 2004
    #6
  7. Rigga

    Rigga Guest

    Mark Parnell wrote:

    > On Tue, 13 Jul 2004 06:26:01 GMT, Rigga <> declared
    > in alt.html:
    >
    >> .colorbackground {

    >
    > From your original post:
    >
    >> <div class='colourbackground'>

    >
    > Notice a difference?
    >

    Yeah that was a typo when posting the message, the code doesnt contain that.
    I will check over the entire code and post back later.

    Thanks for all your help so far.

    R
    Rigga, Jul 13, 2004
    #7
  8. Rigga

    Mark Parnell Guest

    On Tue, 13 Jul 2004 16:21:44 GMT, Rigga <> declared
    in alt.html:

    > Yeah that was a typo when posting the message, the code doesnt contain that.


    Yet another reason that cut and paste is not at all helpful - we need a
    URL. Make up a quick and dirty test page if you can't put the original
    online.

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
    "Never drink rum&coke whilst reading usenet" - rf 2004
    Mark Parnell, Jul 14, 2004
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Q2hyaXM=?=

    ASP.NET Server.ScriptTimeout being ignored

    =?Utf-8?B?Q2hyaXM=?=, May 14, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    5,397
    Cowboy \(Gregory A. Beamer\)
    May 14, 2004
  2. David Hearn
    Replies:
    1
    Views:
    646
    Ken Dopierala Jr.
    Oct 27, 2004
  3. Christian Seberino
    Replies:
    5
    Views:
    815
    Christian Seberino
    Oct 9, 2003
  4. james t kirk
    Replies:
    2
    Views:
    316
    Bengt Richter
    Nov 20, 2005
  5. Replies:
    2
    Views:
    469
    Mike Treseler
    Apr 4, 2007
Loading...

Share This Page