zavin Posted September 27, 2010 Share Posted September 27, 2010 Who can I make an echoed table wrap or break after displaying 4 or 5 items. The code below will display $item from left to right like I need it, but I need it to break to the next line after it the first 4 or 5 item. Any help would be appreciated. $item = "<td width='25%' align='center'> <img src='". $worked2['image']."' width='100' height='100' style='border: 1px solid #333333'><br> ". item_popup($worked2['itemname'], $worked2['id']) ." [x".$line['quantity']."]<br> $". $worked2['cost'] ."</td> <td>"; echo $item; "</td>"; Link to comment https://forums.phpfreaks.com/topic/214493-wraping-a-table/ Share on other sites More sharing options...
Pikachu2000 Posted September 27, 2010 Share Posted September 27, 2010 It isn't real clear just what you mean. Are you trying to move to the next table row, and what do you mean by 4 or 5 items? Link to comment https://forums.phpfreaks.com/topic/214493-wraping-a-table/#findComment-1116131 Share on other sites More sharing options...
zavin Posted September 27, 2010 Author Share Posted September 27, 2010 $item displays a table of data retrieved from a data base it loops until every item is displayed on the page. The problem is that displays 20 items from left to right, but you can only see 5 of them in the browser. I need it to wrap to the next line after each set of 5 items displayed. Link to comment https://forums.phpfreaks.com/topic/214493-wraping-a-table/#findComment-1116134 Share on other sites More sharing options...
sasa Posted September 27, 2010 Share Posted September 27, 2010 look here http://www.phpfreaks.com/forums/index.php/topic,95426.0.html Link to comment https://forums.phpfreaks.com/topic/214493-wraping-a-table/#findComment-1116143 Share on other sites More sharing options...
Pikachu2000 Posted September 27, 2010 Share Posted September 27, 2010 Ah, that clears it up. I assume this is coming from a while() loop after a DB query, yes? EDIT: The link posted above is pretty much where I was going with this anyhow . . . Link to comment https://forums.phpfreaks.com/topic/214493-wraping-a-table/#findComment-1116147 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.