liamrlph Posted June 4, 2010 Share Posted June 4, 2010 Hi everyone, I'm kind of confused on how to do this. I want to create a table similar to a spreadsheet that will look something like: [/td]201020112012 Monday10 Tuesday15 Wednesday[td] The values will just be integers which I would like to be able to edit. For example the cell for Tuesday 2010 might be 10. Anyone can help or show me something that will. I appreciate any help. Many Thanks, Liam Quote Link to comment https://forums.phpfreaks.com/topic/203868-create-a-table-like-a-spreadsheet/ Share on other sites More sharing options...
gwolgamott Posted June 4, 2010 Share Posted June 4, 2010 A simple sample of something like this? <html> <head> <style type="text/css"> table, td, th { border:1px solid green; } th { background-color:green; color:white; } </style> </head> <body> <table> <tr> <th>Firstname</th> <th>Lastname</th> <th>Savings</th> </tr> <?php while($my_variable > $count)//loop something here for number of rows you want { echo "<tr>"; // begin of a row for($i=0;$i<4;$i++) // loop through 3 time to match three header columns { echo('<td>Lois</td> <td>'.$variable.'</td> <td>$150</td>'); } echo "</tr>" //end of a row $my_variable--; } ?> </table> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/203868-create-a-table-like-a-spreadsheet/#findComment-1067742 Share on other sites More sharing options...
Sergey Popov Posted June 4, 2010 Share Posted June 4, 2010 If, as you mentioned, you like to edit values in such spreadsheet, there need to be a html form with input text fields (integrated to the html code suggested by gwolgamott). Also to store edited values you'll need to save them to database or text file. Quote Link to comment https://forums.phpfreaks.com/topic/203868-create-a-table-like-a-spreadsheet/#findComment-1067755 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.