CRO8 Posted May 5, 2004 Posted May 5, 2004 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! Quote
borfast Posted May 5, 2004 Posted May 5, 2004 It appears to be working just fine, here. I don't see anything wrong with your code, either. Quote
CRO8 Posted May 5, 2004 Author Posted May 5, 2004 huh, weird. Im on IE 6 and the results overlap eachother . . . Quote
Venusian31 Posted May 5, 2004 Posted May 5, 2004 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. Quote
borfast Posted May 5, 2004 Posted May 5, 2004 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... Quote
btrfld Posted May 5, 2004 Posted May 5, 2004 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 Quote
CRO8 Posted May 5, 2004 Author Posted May 5, 2004 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 Quote
btrfld Posted May 5, 2004 Posted May 5, 2004 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. Quote
CRO8 Posted May 5, 2004 Author Posted May 5, 2004 ok cool I will try it tonight. page link I provided will not work b/c I fiddled with code . . . Thanks! Quote
CRO8 Posted May 7, 2004 Author Posted May 7, 2004 thanks so muc for all your help- I got my page to work next up applying CSS. Thanks! Quote
btrfld Posted May 7, 2004 Posted May 7, 2004 My pleasure. I'm glad it worked. Of course feel free to keep asking. As the Gurus say, we love to help! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.