Jump to content

Recommended Posts

Posted

Hello all:

 

I tried to use CSS to control page positioning for this line of code that prints results of a query, location is correct but it keeps printing over each other:

 

>// simple loop to display all the results in the array
if ($row = mysql_fetch_array($result)) {

do {
print "<div id='print_category'><center><b>" . $row['name'] . "  " . "<font color='blue'><u>" . $row['offer_url'] . "</u></font>" .  "  " . $row['c_code'] . "  " . "</b></center></div>" . "<br><br>\n";
  }

 

this page show that my results are printing in middle of page, on one line. I understand why. It keeps printing over each other.

 

How can I get it to print on separate lines?

 

Thanks!

Posted

I just tried it with my IE6 browser and it overlapped for me, too, but when I viewed it with FireFox, it shows up fine. It must be an IE thing. IE has a lot of problems sometimes.

Posted

Same here. With FireFox, everything shows up just fine but when I tried it on my sister's computer (IE6), all the lines were overlapped... that's really odd, it shouldn't happen... :P

Posted

I have the same results, with the addition that Opera7 seems to behave like IE6.

 

Perhaps they're reacting to the fact that you've given all the result <div>s the same ID

<div id='print_category'>
when you're actually supposed to have only one thing in a page with the same ID.

 

You might try adding an incrementing number to the ID and see if it changes:

$i=0;

do {

print "<div id='print_category$i'><center><b>" . $row['name'] . "  " . "<font color='blue'><u>" . $row['offer_url'] . "</u></font>" .  "  " . $row['c_code'] . "  " . "</b></center></div>" . "<br><br>\n";

$i++;

  }

 

Hope it helps

Jim :P

Posted

hey thanks guys- weird how it displays fine in other browsers and not IE and Opera 7. Anyways, btrfld's idea seems to work in incrementing the results but I lose control over positioning . . .

 

the results

Posted

I'm glad it worked somewhat. If you're using the ID for CSS styling/positioning, try making it a CLASS instead of an ID. You can have as many things as you want with the same class.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...