Bluehost.com Web Hosting $6.95

Turning string into a table

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-13-2003
Zavaboy
 
Posts: n/a
Default Turning string into a table

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


Reply With Quote
  #2 (permalink)  
Old 07-14-2003
Jeff Harris
 
Posts: n/a
Default Re: [PHP] Turning string into a table

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.


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:17 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0