[PHP] Creating a table with merged cells

2007-08-23 Thread Phpmanni

Hi
I need to represent a sort of map. The map is a rectangular
table of size X in widht and Y in height, so that I have X*Y
square cells. I need to record in a database some infos for
each cell.
This is easy, I thought to use a record that is something
like (X,Y,MyData), so with two nested loops I can create the
HTML table with data in it.
The problem is that I need to join adjacent cells, so that I
can obtain bigger cells made of base little square cells.
So, starting from a table like this (see with fixed size font)
+-+-+-+-+-+-+-+-+-+
| | | | | | | | | |
+-+-+-+-+-+-+-+-+-+
| | | | | | | | | |
+-+-+-+-+-+-+-+-+-+
| | | | | | | | | |
+-+-+-+-+-+-+-+-+-+

I must find a way to store in the database a table like this
+-+-+-+-+-+-+-+-+-+
| 2 | | | |4 cells|
+-+-+-+-+-+-+-+-+-+
| |BIGBIGB| | | | |
+-+BIGBIGB+-+-+-+-+
| |BIGBIGB| | | | |
+-+-+-+-+-+-+-+-+-+

I thougt to use a record like (X,Y,XWIDTH,YHEIGHT,DATA), but
I cannot imagine the way to create the resulting HTML table.
Using graphics will be a lot easyer, but I must insert
combos and checkboxes into the cells, so I must use html...
Any ideas?

Thanks!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Creating a table with merged cells

2007-08-23 Thread Phpmanni

Yes, I know I can use colspan and rowspan.
Colspan is easy, I have problems when cells are vertically merged...
You must build the table from the top and it is not easy to know for each 
row if they get some piece of cell from the preceding one. And you can have 
cells from the first to the last row of a table... 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php