This is a discussion on Turning string into a table within the PHP General forums, part of the PHP Programming Forums category; Is there a way to make for example: // (Column info) // String 1: [This column holds [Col 1] [Col 2]] [This ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Is there a way to make for example:
// (Column info) // String 1: [This column holds [Col 1] [Col 2]] [This second column holds [Col 3] [Col 4]] // (Row) // String 2: [Col 1 (row1)] [Col 2 (row1)] [Col 3 (row1)] [Col 4 (row1)] // (Row) // String 3: [Col 1 (row2)] [Col 2 (row2)] [Col 3 (row2)] [Col 4 (row2)] // How do I turn the above strings into a table? // Like this: <table> <tr> <td colspan=2>This column holds</td> <td colspan=2>This second column holds</td> </tr> <tr> <td>Col 1</td> <td>Col 2</td> <td>Col 3</td> <td>Col 4</td> </tr> <tr> <td>Col 1 (row 1)</td> <td>Col 2 (row 1)</td> <td>Col 3 (row 1)</td> <td>Col 4 (row 1)</td> </tr> <tr> <td>Col 1 (row 2)</td> <td>Col 2 (row 2)</td> <td>Col 3 (row 2)</td> <td>Col 4 (row 2)</td> </tr> </table> You get the idea... So, any idea how to do that? I want it to work correctly no matter how many rows and columns there are. -- - Zavaboy zavaboy@hotmail.com www.zavaboy.com |
|
|||
|
On Jul 13, 2003, "zavaboy" claimed that:
|Is there a way to make for example: | |// (Column info) |// String 1: |[This column holds |[Col 1] |[Col 2]] |[This second column holds |[Col 3] |[Col 4]] | |// (Row) |// String 2: |[Col 1 (row1)] |[Col 2 (row1)] |[Col 3 (row1)] |[Col 4 (row1)] | |// (Row) |// String 3: |[Col 1 (row2)] |[Col 2 (row2)] |[Col 3 (row2)] |[Col 4 (row2)] | |// How do I turn the above strings into a table? [snipped] |You get the idea... |So, any idea how to do that? |I want it to work correctly no matter how many rows and columns there are. | Not sure if this is exactly what you need, but it "makes the design of HTML tables easy, flexible, reusable and efficient." http://pear.php.net/package-info.php?package=HTML_Table -- Registered Linux user #304026. "lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import" Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED Responses to this message should conform to RFC 1855. |