小编Gol*_*ers的帖子

mPDF:文本与表中的p,h1 - h6对齐不起作用

这段代码在mPDF php类的表中不起作用 在此输入图像描述

    <table>
    <tr>
      <td class="contentDetails">
  <td class="contentDetails">
         <h3 style="text-align: right;"><strong>text align right</strong></h3>
         <h3 style="text-align: center;"><strong>text align center</strong></h3>
         <h3 style="text-align: left;"><strong>text align left</strong></h3>
     </td>
    </tr>
    </table>
Run Code Online (Sandbox Code Playgroud)

我使用黑社会

.contentDetails > h3 {display: block;} 
Run Code Online (Sandbox Code Playgroud)

但是没有工作,在td之间是来自编辑器tinymce的html

来自脚本的完整代码以及何时输出找到的内容,td文本左对齐或不对齐

<?php

$html = '
<h1>mPDF</h1>
    <table style="border-collapse: collapse;
    font-size: 12px;
    font-weight: 700;
    margin-top: 5px; 
    border-top: 1px solid #777;
    width: 100%;">
<tbody>
<tr>
  <td class="contentDetails">
         <h3 style="text-align: right;"><strong>text align right</strong></h3>
         <h3 style="text-align: center;"><strong>text align center</strong></h3>
         <h3 style="text-align: left;"><strong>text align left</strong></h3>
     </td>
</tr>
</tbody>
</table>';

include("mpdf.php");

$mpdf=new mPDF('c'); …
Run Code Online (Sandbox Code Playgroud)

html css php tinymce mpdf

2
推荐指数
2
解决办法
7782
查看次数

标签 统计

css ×1

html ×1

mpdf ×1

php ×1

tinymce ×1