View Full Version : [PHP/HTML] Tables Help (+REP)
Drompo
18-05-2007, 07:02 PM
How to you make a table warp pages.
My Input is database information and i want it to create a table or coloum for each result found. Easy?
Well, that was
How could you manage to do it so if there was too many to fit on one line, it went onto the next, Get what i mean?
Now thats the hard part
Thanks
:Edzy
18-05-2007, 07:07 PM
Err.. What? Sozzeh :)
Drompo
18-05-2007, 07:09 PM
Say The £ is my table
Instead of
££££££££££££££££££££££££££££££££££££££££££££££££
Have
££££££££££££££££££
££££££££££££££££££
££££££££££££££££££
Easier?
LondonGoons
18-05-2007, 07:14 PM
<HTML><BODY>
<TABLE WIDTH="80%"
CELLSPACING=0 CELLPADDING=0 BGCOLOR="#EEEEEE">
<TR><TD>
Paragraph #1.<BR>
Paragraph #2.<BR>
Paragraph #3.<BR>
</TD></TR>
</TABLE>
</BODY></HTML>
Is that what you meant?
Romanity
18-05-2007, 07:20 PM
Heres what ya want.... i think...
<?
echo("<table width='100%'>
<tr>");
$i=1;
$query = mysql_query("QUERY") or die(mysql_error());
while($rows = mysql_fetch_array($query)
{
echo("<td>CONTENT FROM DATABASE</td>");
if($i == x) // Change x to the number you want on each row
{
echo("</tr><tr>");
$i=0;
}
$i++;
}
echo("</tr></table>");
?>
That will extract the info from the database, put it in a table.... and put it onto a new row depending on the value of X
Have a play with it ;)
Drompo
18-05-2007, 07:25 PM
Edit: It Works, Thanks +rep
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.