我正在尝试使用mPDF在PHP中生成PDF。
我的文档的一部分必须是这样的:(来源:cloudandfun.com)
所以我写了HTML:
<table style = "width:100%">
<tr>
<td>Appellation <br>(par ordre de préférence)</td>
<td style = "border:0px;">
<table style = "width:100%; border:0px;">
<tr style = "border:0px;"><th style = "border:0px;">Abréviation (S’il y a lieu)</th></tr>
</table>
<table style = "width:100%;border:0px;">
<tr style = " border:0px;">
<td style = "width:33%;border-bottom:0px;border-left:0px;">Abréviation</td>
<td style = "width:33%;border-bottom:0px;border-left:0px;">Facultative</td>
<td style = "width:33%;border-bottom:0px;border-left:0px;border-right:0px;">Obligatoire</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>1.</td>
<td>
<table style = "width:100%;border:0px;">
<tr style = " border:0px;">
<td style = "width:33%;border-bottom:0px;border-left:0px;border-top:0px;">--</td>
<td style = "width:33%;border-bottom:0px;border-left:0px;border-top:0px;">--</td>
<td style = "width:33%;border:0px;">--</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>2.</td>
<td>
<table style = "width:100%;border:0px;">
<tr style = " border:0px;">
<td style = "width:33%;border-bottom:0px;border-left:0px;border-top:0px;">--</td>
<td style = "width:33%;border-bottom:0px;border-left:0px;border-top:0px;">--</td>
<td style = "width:33%;border:0px;">--</td>
</tr>
</table>
</td>
</tr>
我的CSS:
th,td,tr {
border:1px solid black;
border-collapse:collapse;
}
table {
border:2px solid black;
border-collapse:collapse;
}
td {
font-family:Arial;
font-size:11px;
}
在html页面中,它工作得很好,但是在生成pdf时,它看起来像这样:(源:cloudandfun.com)
有人对此有解决方案吗?提前致谢。
参考方案
我有解决方案,而不是给%我给px的宽度,它的工作。
结论:mPDF不支持%(宽度:33%;对于我的示例),但支持px(宽度:100px;对于我的示例)。 ;);)
有没有一种方法可以使div上的click事件与表单环境中的单选按钮相同?我只希望下面的div提交值,单选按钮很丑代码输出如下:<input id="radio-2011-06-08" value="2011-06-08" type="radio" name="radio_date…
PHP-复选框组 - php我有一个需要发布的表单复选框组。<input type="checkbox" value="true" checked name="chk0[]"> <input type="checkbox" value="false" name=…
jQuery如果选中则启用动态输入文本 - php我正在使用PHP生成具有表格的表格,例如:<table class="table table-hover"> <thead> <tr> <th class="table-checkbox"> </th> <th> Description </…
故障排除“警告:session_start():无法发送会话高速缓存限制器-标头已发送” - php我收到警告:session_start()[function.session-start]:无法发送会话缓存限制器-标头已发送(错误输出开始如果我将表单数据提交到其他文件进行处理,则可以正常工作。但是,如果我将表单数据提交到同一页面,则会出现此错误。请建议<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0…
php Singleton类实例将在多个会话中保留吗? - php举一个简单的例子,如果我想计算一个不使用磁盘存储的脚本的命中次数,我可以使用静态类成员来执行此操作吗?用户1:<?php $test = Example::singleton(); $test->visits++; ?> 用户2:<?php $test = Example::singleton(); $test->visits+…