html - php to create table rows -
struggling bit (im learning php) create table rows when new user added. have tried re-arranging code still not working.
so here code:
<?php $args1 = array( 'role' => 'committee', 'orderby' => 'user_nicename', 'order' => 'asc' ); $committee = get_users($args1); foreach ($committee $user) { echo ' <table> <tr> <th style="padding: 10px;">job title</th> <th style="padding: 10px;">members name</th> <th style="padding: 10px;">email address</th> <th style="padding: 10px;">telephone number</th> </tr>'; echo ' <tr> <td style="padding: 10px;">' .$user->job_title .'</td> <td style="padding: 10px;">' . $user->display_name .'</td> <td style="padding: 10px;">'.$user->user_email . '</td> <td style="padding: 10px;">'.$user->tel_number . '</td> </tr> </table>'; } echo '</ul>'; ?>
the problem facing when new user added creates table headers require second row?
so echo <table>
before loop.
echo "<table>"; foreach () { echo "<tr>...</tr>"; } echo "</table>";
Comments
Post a Comment