Jump to content

populate html table with array


inestine

Recommended Posts

I have a table that allows users to add rows, depending on how much data they need to insert. upon submit I'd like to populate another table for review. Now I can generate the data, but I'm having trouble putting the array into a table. Here is the output from the initial page:

 

Array
(
    [quantity] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
        )

    [description] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
        )

    [unit_cost] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
        )

    [shipping] => 4
    [tax] => 5
    [review_po] => Review
)

 

I need it to look like this:

Quantity | Description | Unit Cost

1            | 1                | 1

2            | 2                | 2

3            | 3                | 3

                Tax              | 4

                Ship            | 5

 

I think it's a foreach statement, but I'm not having any luck..

 

If someone could point me in the right direction???

Link to comment
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.