<div> Surrounding Print Functions

Hello all:<br /><br />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:<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->// simple loop to display all the results in the array<br />if ($row = mysql_fetch_array($result)) {<br /><br />do {<br />print "<div id='print_category'><center><b>" . $row['name'] . "&nbsp;&nbsp;" . "<font color='blue'><u>" . $row['offer_url'] . "</u></font>" . ?#34;&nbsp;&nbsp;" . $row['c_code'] . "&nbsp;&nbsp;" . "</b></center></div>" . "<br><br>\n";<br /> ?}<!--c2--></div><!--ec2--><br /><br /><a href="http://www.couponpile.com/Greg_xhtml_css.php?cid=1" target="_blank">this page</a> show that my results are printing in middle of page, on one line. I understand why. It keeps printing over each other.<br /><br />How can I get it to print on separate lines?<br /><br />Thanks!<!--content-->
It appears to be working just fine, here. I don't see anything wrong with your code, either. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/unsure.gif" style="vertical-align:middle" emoid=":unsure:" border="0" alt="unsure.gif" /><!--content-->
huh, weird. Im on IE 6 and the results overlap eachother . . .<!--content-->
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.<!--content-->
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... <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/huh.gif" style="vertical-align:middle" emoid=":huh:" border="0" alt="huh.gif" /><!--content-->
I have the same results, with the addition that Opera7 seems to behave like IE6.<br /><br />Perhaps they're reacting to the fact that you've given all the result <div>s the same ID<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec--><div id='print_category'><!--QuoteEnd--></div><!--QuoteEEnd-->when you're actually supposed to have only one thing in a page with the same ID.<br /><br />You might try adding an incrementing number to the ID and see if it changes:<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec--><b>$i=0;</b><br />do {<br />print "<div id='print_category<b>$i</b>'><center><b>" . $row['name'] . "&nbsp;&nbsp;" . "<font color='blue'><u>" . $row['offer_url'] . "</u></font>" .  "&nbsp;&nbsp;" . $row['c_code'] . "&nbsp;&nbsp;" . "</b></center></div>" . "<br><br>\n";<br /><b>$i++;</b><br />  }<!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />Hope it helps<br />Jim <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/goof.gif" style="vertical-align:middle" emoid=":goof:" border="0" alt="goof.gif" /><!--content-->
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 . . .<br /><br /><a href="http://www.couponpile.com/Greg_xhtml_css.php?cid=1" target="_blank">the results</a><!--content-->
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.<!--content-->
ok cool I will try it tonight. page link I provided will not work b/c I fiddled with code . . .<br /><br />Thanks!<!--content-->
thanks so muc for all your help- I got <a href="http://www.couponpile.com/Greg_xhtml_css.php?cid=1" target="_blank">my page to work</a><br /><br />next up applying CSS.<br /><br />Thanks!<!--content-->
My pleasure. I'm glad it worked. Of course feel free to keep asking. As the Gurus say, we love to help!<!--content-->
sounds good <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
 
Top