Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.