Hi guys,

I've been struggling for days now with this issue and maybe I'm just not approaching the problem from the right angle.

Here is what I want to do in my project (which is an online psychological experiment):

I'm trying to build a big table about 100 100 big. something that will look like this http://www.smilebga.com/test.php (this is a smaller version 1010). The user will choose a cell and then assign it a certain color.
However, because a 100 * 100 table is too big to show on the screen properly, I thought about presenting it as a series of 9 image snapshots. Somthing like this:

block 1 block 2 block 3
block 4 block 5 block 6
block 7 block 8 block 9

Only when the user will clink on one of the block's image he will be directed to an php page that will actually present the real table.
In order to achieve what I had in mind I figure I need to do the following steps:

  1. A php page draw the data about the table from the database, and construct the table block (9 in total).

  2. Conversion of each table to an image

  3. Assemble these images in a table in another php page which the user will actually see.

I figured out stages 1 and 3 without any serious difficulties, but I am stuck in stage 3. The method I tried to use in this case were converting the php table to a pdf using html2pdf but that fails since I'm only getting a black page.

Would really appreciate your help on this and any other suggestion of achieving my project goals.

Thanks

    What's the reason you want the table in PDF format? Is it for download or mailing purpose?
    Post the file/link for the htmltopdf library u are trying to make working.

      I actually don't need a pdf. I need to make a snapshot of the table, and present it as an image file. The only way I found of doing something like that was html2pdf. But if you have other solution it will be great.

        Here's a full answer to your question.

        1. I actually don't need a pdf. I need to make a snapshot of the table, and present it as an image file.

        2. It is neither for downloading or for email. I can't show the user a table with 10,000 cells. Especially if he can select only one cell and choose a color to fill that cell.

        In order to do so, I though about presenting the table with 10,000 cell as a series of 9 images (to make one big image) that are linked to 9 different pages. Every page will show a smaller segment of the big table with only 3,333 cells.

        Is that more clear?

        You can view html2pdf here: http://www.macronimous.com/resources/Converting_HTML2PDF_using_PHP.asp

          PHP's [man]image[/man] functions should be able to work with a 100x100 image without any trouble. You'd want to use truecolour and PNG output.

          If you want users to select cells, then you can put it in a form as an image field; when they click in a cell, the x/y coordinates of where they clicked are submitted (along with the other form data) to the processing script, and from those coordinates you can infer which cell they chose.

          Note that the script producing the page and the script producing the image would be two separate things, as they browser first requests one and then requests the other.

          For the mouseover effect ... an image input wouldn't really offer that, unfortunately. But maybe some JavaScript could be used to float a wee <div> in the appropriate spot.

          For a whole 'nother approach, Stu Nicholls has done some remarkable things with CSS (the example I've linked to is only one demo on that site that may be relevant to you, even if it isn't that practical).

            Thanks Weedpacket,

            Can you post an example or a link to a similar example to the first solution you spoke about?

              Write a Reply...