1

Hi everybody,

Im Using html2PDF to generate a couple of reports. However, this reports are in form of nested tables. Generally, html2pdf does here a very good job because I nearly dont have to care about the layout an so one. Thanks to the developper for this great tool.
Unfortunately, in some case, the provided content is so big, that a single cell can't be displayed on the page properly. Either the cells get plotted in a strange way or the class reports even an error. I tried to find a workaround but I could not achieve. (Of course, I tried allready the parameter "setTestTdInOnePage", but this does not result in the correct way)
Does anybody know a solution or has probably allready written an extension to manage this problem?

Thanks for any help and support.....

Fabian

2

Bonjour,

Voila comment je fais pour que mes tableaux soient toujours OK:

__________________________________________________________________________________________________________________________________________
<table border="1" cellspacing="0" style="width:95%; text-align:center; valign:middle; margin-top:3%;" align="center" charset="utf-8">
<thead>
<tr style="font-size:13px; background-color: CMYK(255, 0, 0, 0);">
<th style="width:20%" scope="col">Col1</th>
<th style="width:20%" scope="col">Col2</th>
<th style="width:20%" scope="col">Col3</th>
<th style="width:20%" scope="col">Col4</th>
<th style="width:20%" scope="col">Col5</th>
</tr>
</thead>
<?php while ($datas = mysql_fetch_assoc($req)) { ?>
<tbody>
<tr style="font-size:10px;">
<td style="background-color:RGB(229, 229, 229)"><?php echo $datas['Col1'];?></td>
<td><?php echo $datas['Col2'];?></td>
<td><?php echo $datas['Col3'];?></td>
<td><?php echo $datas['Col4'];?></td>
<td style="width:310px;"><?php echo $datas['Col5'];?></td>
</tr>
</tbody><?php }?>
</table>
_______________________________________________________________________________________________________________________________________________________


Si vous voulez être sur que les colonnes soient fixe, mettez un "width" fixe:
<td style="width:310px;"><?php echo $datas['Col5'];?></td>

Bonne soirée smile

3

Hi,
Happy new year everybody

@maxredphenix: Thanks for your answer. Unfortunately, I did not explain the problem clear enough. I don't have a problem with the page's width, but width the heigth.

An example-table to illustrate the behaviour would be (just the table, without thead etc.):

<table>
<tr>
<td rowspan=50>
MonsterBigContent
</td>
<td>
1 ContentBelongToMonsterBigContent
</td>
</tr>
<tr>
<td>
2 ContentBelongToMonsterBigContent
</td>
</tr>
<tr>
<td>
3 ContentBelongToMonsterBigContent
</td>
</tr>
.
.
.
<tr>
<td>
50 ContentBelongToMonsterBigContent
</td>
</tr>
</table>

If I would plot this table with html2pdf, MonsterBigContent can not be printed on one page (as you adviced, I also fix the column-widht, so the cell-height becomes variabel). The first page will be created more or less correct, but for the second, third and so one, the first column will be overwritten by its thead-tag. This looks very strange and it leeds the reader to confusion. Cool would be the same behaviour as for exampel word provides (cut MonsterBigContent and open the cell on the next page again)

Anybody an idea?

4

Bonjour,

Le contenu de vos cellules est le même à chaque fois?

Si oui, vous pouvez créer des hauteurs fixes
Largeur : 1654 pixels
Hauteur : 2339 pixels

Dans le cas contraire, si vous avez une idée approximative du texte dans vos cellules, fixer le "rowspan" à "XX" cellules, puis forcer le commencement d'une nouvelle page avec un nouveau "rowspan".

En espérant que cela vous convienne.....

5

maxredphenix (./4) :
En espérant que cela vous convienne.....

Malheureusement pas. Je ne peux pas savoir combien de text va etre dans une cellule et je ne sais aussi pas combien des cellules sont dans une relation avec une autre (combien de rowspan va etre necessaire). Le tableaux va etre creer dynamic par l'utilisateur de l'application. (entre 3 jusque 5 colonnes avec n cellulles dans chaque colonne).
Tout facon, dans le moment du creation du tableax-html, je preferais de pas m'ocuper d'une hateur d'une celulle en pixel ou mm pour regarder si la cellule peut etre afficher sur une page. (Parce que si je change l'orientation du page, le font ou bien la taille de footer et header, la calculation va etre faux).
Ca devrait plutot etre regler par html2pdf (ou bien une extension)

Salutation de la Suisse

Fabian

6

Bonjour,

Je t'avoue que la, je ne peux plus t'aider. C'est vrai que la mise en forme des tableaux devrait être plus simple et pratique avec html2pdf, mais bon.....

Bonne continuation

7

Does that mean there is no workaround for this? I also have this problem with a patient-tracking system. One section has a list of patient symptoms, conditions, etc. which is in one table cell (<td>). If the cell does not fit vertically on the page I receive this error.