not sure if this is the correct place to post but here we go anyway.

what i am trying to do is put a table inside a div tag held within a php page but it is not working. here is the code

print "<h4>There are $num_rows records.<P></h4>";
print "<div style=\"width: 650; height:50; overflow-y: scroll\">";  
print "<table width=600 border=0>\n"; 
while ($get_info = mysql_fetch_row($result)){ 
print "<tr>\n"; 
foreach ($get_info as $field) 
print "\t<td><font face=arial size=1/>$field</font></td>\n"; 
print "</tr>\n"; 
} 
print "</table>\n";
print "</div>";

the scroll bar does not get used as the table just keeps expanding down the page.

sorted changed the code to this and it works fine now

print "<h4>There are $num_rows records.<P></h4>";
echo "<div style=\"height: 150px; width: 100%; overflow:auto;\">";
print "<table width=600 border=0>\n"; 
while ($get_info = mysql_fetch_row($result)){ 
print "<tr>\n"; 
foreach ($get_info as $field) 
print "\t<td><font face=arial size=1/>$field</font></td>\n"; 
print "</tr>\n"; 
} 
print "</table>\n";
print "</div>";
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.