我在HTML中创建了一个包含4列和X行的表。在最后一列的每个单元格中都有一个textarea,我为高度设置了内联样式:100%。查看生成的HTML,看起来像预期的那样。但是,当我将其写入PDF时,textarea不适合单元格。第一行很好,但所有后续行都与第一行的高度相同,即使它太小或太大。有没有办法让textarea用TCPDF填充单元格?
这是我的html,为了TCPDF,它存储在$html
中:
<table id="tests" border="1">
<tbody>
<tr id="test">
<td width="248px">
<ol start="1">
<li>
<label>This is a really short message</label>
</li>
</ol>
<
/td>
<td width="71">
<label><input class="" id="passfail1" name="passfail1" type="radio" value="0"></label>
</td>
<td width="71">
<label><input class="" id="passfail1" name="passfail1" type="radio" value="0"></label>
</td>
<td width="247.5">
<textarea class="" id="comments1" style="height: 100%;" cols="30" name="comments1"></textarea>
</td>
</tr>
<tr id="test">
<td width="248px">
<ol start="2">
<li>
<label>This is a tall cell</label>
</li>
<ol start="1">
<li>
<label>We have lots of stuff to discuss here</label>
</li>
<li>
<label>Really long text about how awesome I am and how cool I look and how everything is awesome</label>
</li>
<li>
<label>Everything is cool when you're part of a team</label>
</li>
</ol>
</ol>
</td>
<td width="71">
<label><input class="" id="passfail2" name="passfail2" type="radio" value="0"></label>
</td>
<td width="71">
<label><input class="" id="passfail2" name="passfail2" type="radio" value="0"></label>
</td>
<td width="247.5">
<textarea class="" id="comments2" style="height: 100%;" cols="30" name="comments2"></textarea>
</td>
</tr>
</tbody>
</table>
这是TCPDF函数调用:
$pdf->writeHTMLCell( '', '', $Margins['left'] - 1, '', $html, 0, 0, false, 'C', false );