Forum Moderators: coopster
First, the relevant code:
if ($result) {
echo '<table align="center" cellpadding="0" cellspacing="0" border="0">';
echo "<tr>\n";
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
echo '<td class="scroller" id="scroller'.$row[0].'">'.$row[1].'</td>';
}
echo "</tr>\n";
echo "<tr>\n";
mysql_data_seek($result, 0);
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
echo '<td class="scroller" id="delete'.$row[0].'"><a href="javascript:deleteScroller(\''.$row[0].'\')">delete</a></td>';
}
echo "</tr>\n";
echo "</table>";
} else {
echo "Library quotes";
}
All this does is create a very simple table with only 2 rows. I loop through the same results twice, the second time after calling mysql_data_seek to reset the pointer. The data is correct when it's read by the php.
However, when it is displayed in the browser, the second row does not look like it's part of the same <table>! It looks like a new table has been created by the browser, or maybe it's nesting the second row inside the first somehow.
Weirder, the generated source code in the browser (View Source) looks fine, and when I paste that code into a dummy document, everything looks fine.
What am I missing?
Thanks,
Glenn
[1][[b]edited by[/b]: jatar_k at 2:44 pm (utc) on July 28, 2009][/1]
[1][edit reason] no personal urls please [url=http://www.webmasterworld.com/help.cgi?cat=tos]TOS[/url] [/edit][/1]
are all tr/td/table matched up?
are there stray divs? or divs at all?
something must change when you paste it into another doc, doctype?