Merging table cells in rows with the same name into one cell in wordpress

campaign one    campaign description    [ybr_scode business_id="ippudo-singapore-3" review="blo" layout="hori"]  
campaign one    campaign description    [ybr_scode business_id="din-tai-fung-singapore-4" review="blo" layout="hori"]

This is how I would like the data to be:

  campaign name       campaign desc             shortcode              
                                                                      action

                                                [ybr_scode business_id="ippudo-singapore-3" review="blo" layout="hori"]
campaign one      campaign description          [ybr_scode business_id="din-tai-fung-singapore-4" review="blo" layout="hori"]           print

And may code is

global $wpdb;
                    $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "ybr_yelp_business");
                    foreach ($rows as $row){
                        echo '<tr id="campaign_delete">
                        <td>'.$row->campaign_name.'</td>
                        <td>'.$row->campaign_text.'</td>
                        <td>[ybr_scode business_id="'.$row->business_id.'" review="'.$row->display_option.'" layout="'.$row->display_layout.'"]</td>
                        <td class="text-center"></td>

                             </tr>';
                    }

I have data in one table that contains several rows of data for the same time. I would like to create a table where all the data for the same time is displayed on the same row and also date is displayed on the same row

Read more here: Merging table cells in rows with the same name into one cell in wordpress

Leave a Reply

Your email address will not be published. Required fields are marked *