0

将以下 html 提交到我的 html2pdfconverter.php 文件时,导出中省略了生物信息疾病和伤害标题:

<div id = "container" style="width: 625px;">
    <div id = "leftcontainer">
        <h4>Biological Information</h4>
        <div id = "bioinfo">
            <ul>
                <li><span>Morning Bodyweight (kg): </span></li>
                <li><span>Evening Bodyweight (kg): </span></li>
                <li><span>Morning Heart Rate (bpm): </span></li>
            </ul>
        </div>

        <h4>Fatigue & Recovery</h4>
        <div id = "fatigue">
            <ul>
                <li><span>Estimated Fluid Consumption (Litres):</span></li>
                <li><span>Sleep Quality:</span></li>
                <li><span>Sleep Quantity (Hours): </span></li>
                <li><span>Mental Recovery:</span></li>
                <li><span>Physical Recovery:</span></li>
                <li><span>Pre-Training Energy:</span></li>
                <li><span>Muscle Soreness:</span></li>
                <li><span>General Fatigue:</span></li>
            </ul>
        </div>                                                
    </div>
    <div id = "rightcontainer">                                                                                   
        <h4>Illness & Injury</h4>
        <div id = "illness">
            <ul>
                <li><span>Are You Ill:</span></li>
                <li><span>Are You Injured:</span></li>
            </ul>
        </div>

        <h4>Training</h4>
        <div id = "training">
            <ul>
                <li><span>Morning Session Duration (minutes):</span></li>
                <li><span>Morning Session Intensity:</span></li>
                <li><span>Evening Session Duration (minutes):</span></li>
                <li><span>Evening Session Intensity:</span></li>
            </ul>
        </div>

        <h4>General Comments</h4>
        <div id = "comments">
            <ul>
                <li><span>General Feedback (10 - 100 characters):</span></li>
            </ul>
        </div>
    </div>
</div>

我得到以下信息:

<div id = "container" style="width: 625px;">
    <div id = "leftcontainer">
        <div id = "bioinfo">
            <ul>
                <li><span>Morning Bodyweight (kg): </span></li>
                <li><span>Evening Bodyweight (kg): </span></li>
                <li><span>Morning Heart Rate (bpm): </span></li>
            </ul>
        </div>

        <h4>Fatigue & Recovery</h4>
        <div id = "fatigue">
            <ul>
            <li><span>Estimated Fluid Consumption (Litres):</span></li>
                <li><span>Sleep Quality:</span></li>
                <li><span>Sleep Quantity (Hours): </span></li>
                <li><span>Mental Recovery:</span></li>
                <li><span>Physical Recovery:</span></li>
                <li><span>Pre-Training Energy:</span></li>
                <li><span>Muscle Soreness:</span></li>
                <li><span>General Fatigue:</span></li>
            </ul>
        </div>
    </div>

    <div id = "rightcontainer">                                                                                        
        <div id = "illness">
            <ul>
                <li><span>Are You Ill:</span></li>
                <li><span>Are You Injured:</span></li>
            </ul>
        </div>

        <h4>Training</h4>
        <div id = "training">
            <ul>
                <li><span>Morning Session Duration (minutes):</span></li>
                <li><span>Morning Session Intensity:</span></li>
                <li><span>Evening Session Duration (minutes):</span></li>
                <li><span>Evening Session Intensity:</span></li>
            </ul>
        </div>

        <h4>General Comments</h4>
        <div id = "comments">
            <ul>
                <li><span>General Feedback (10 - 100 characters):</span></li>
            </ul>
        </div>
    </div>
</div>

这一定与它们都是 div 部分下方的第一个标题这一事实有关......我只是不确定为什么它们没有被导出。

正确的 HTML 被发送到 html2pdf 生成器文件。

如果我将 h4 标签更改为 ap 标签,它可以工作......但它不适用于任何其他标题标签......还有其他人遇到过这个问题吗?

4

1 回答 1

0

我有一个相当笨拙的解决方案,但是嘿它有效....

我所做的是在每个新 div 下方的第一个标题上方添加一个空 div。

例如

<div id = "leftcontainer">
<div></div>
<h4>Biological Information</h4>
.
.
.
</div>
于 2011-09-04T18:18:08.377 回答