Turning string into a table
| From: | zavaboy | Date: | Sun, 13 Jul 2003 18:50:28 +0000 |
| Subject: | Turning string into a table | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-155015@lists.php.net to get a copy of this message | ||
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