Jump to content

Wraping a table


zavin

Recommended Posts

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

$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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.