Jump to content

displaying check box choice in a table


ma5ect

Recommended Posts

Hi all, I have a form and few check boxes, when the user selects the choices i want the result to be displayed in a table..i have the follwing code but the text just appears in a list..

 

<table width="200" border="5" cellspacing="2" cellpadding="5">
    <tr>
      <th scope="row"><div align="center"><strong>Days</strong></div></th>
      <td><div align="center"><strong>Time</strong></div></td>
    </tr>
    <tr>
      <th scope="row"><?
} else {
foreach($modulename as $f) {
echo $f."<br />";

}
}echo $schedule."<br />";
?></th>
      <td> </td>
    </tr>
  </table>

Link to comment
https://forums.phpfreaks.com/topic/134349-displaying-check-box-choice-in-a-table/
Share on other sites

You are looping through your array with <br>, this will display like this...

 

Line 1

Line 2

Line 3

 

You need to loop through with your <td> this will display like this... (The dotted lines indicate the table)

 

|-----------------------

|  Line 1

|-----------------------

|  Line 2

|-----------------------

|  Line 3

|-----------------------

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.