Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Div being ignored

Reply
Thread Tools

Div being ignored

 
 
Rigga
Guest
Posts: n/a
 
      07-13-2004
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
 
Reply With Quote
 
 
 
 
rf
Guest
Posts: n/a
 
      07-13-2004

"Rigga" <(E-Mail Removed)> wrote in message
news:e0LIc.19636877$(E-Mail Removed).. .
> 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.


 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      07-13-2004
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
 
Reply With Quote
 
Rigga
Guest
Posts: n/a
 
      07-13-2004
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
 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      07-13-2004
On Tue, 13 Jul 2004 06:26:01 GMT, Rigga <(E-Mail Removed)> 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
 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      07-13-2004

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.


 
Reply With Quote
 
Rigga
Guest
Posts: n/a
 
      07-13-2004
Mark Parnell wrote:

> On Tue, 13 Jul 2004 06:26:01 GMT, Rigga <(E-Mail Removed)> 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
 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      07-13-2004
On Tue, 13 Jul 2004 16:21:44 GMT, Rigga <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
<div ... /> and <div ...></div> K Viltersten ASP .Net 4 03-31-2009 07:33 PM
Embedded <divs> with events: How to prevent the parent div's eventfrom being fired when the embedded div's event is fired? Num GG Javascript 2 11-17-2008 08:56 PM
NS/FF don't change div offsetWidth when div innerHTML is added toand div becomes wider mscir Javascript 3 06-26-2005 04:04 PM
Q: Div A inside Div B is larger than Div B Dwayne Madsen Javascript 1 06-01-2005 03:02 PM
ASP.NET Server.ScriptTimeout being ignored =?Utf-8?B?Q2hyaXM=?= ASP .Net 1 05-14-2004 09:38 PM



Advertisments