javascript - 让 Google Chrome td 在打印页面上换行

标签 javascript html css

在我的网站上,当我按下结果按钮时,结果表以正确的格式显示,例如第一张图片 但是当我点击打印按钮时,表格 formate 被损坏了 有 2 张图片说明了问题

        <table class="table table-bordered">
            <tr class="print-header">
                <th class="table-head" ng-repeat="cols in headercolumns">{{cols}}</th>
            </tr>

            <tr class="table-row" ng-repeat="scoresheet in scoresheets |filter:class">
                <td>
                    <p style="font-size : 20px">{{scoresheet.user.name}}</p>
                    <span>{{scoresheet.user.class.name}}</span>
                </td>
                <td><p style="font-size : 20px">{{scoresheet.result.statistics.score |number}}</p></td>
                <td><p style="font-size : 20px">{{scoresheet.result.statistics.correct_answers}}</p></td>
                <td><p style="font-size : 20px">{{scoresheet.result.statistics.incorrect_answers}}</p></td>
                <td><p style="font-size : 20px">{{scoresheet.result.statistics.partial_answers}}</p></td>
                <td><p style="font-size : 20px">{{scoresheet.result.statistics.pending_answers}}</p></td>
                <td><p style="font-size : 20px">{{scoresheet.result.statistics.skipped_answers}}</p></td>
              </tr>

result table printing table

最佳答案

这解决了我的问题。

@media print {
    td {
        display: table-cell !important; 
    } 
}

关于javascript - 让 Google Chrome td 在打印页面上换行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40360535/

相关文章:

javascript - 检索 HTML 表中复选框选定行的第一列值并相应地修改数据库

javascript - 如何安全地将一段数据放入div标签中?

javascript - javascript/css/html中的 war 卡牌游戏

css - 如何根据另一个不相关元素定义一个元素的宽度?

javascript - NodeJS 中变量范围和 'require' 的奇怪行为

javascript - React Prop 对象数据未定义

javascript - document.getElementById ('rockImg' ).src == "rock.png"似乎没有在 if() block 中执行

html - 当 HTML/CSS 发生错误时将 block 移至更高位置

CSS 应用于 SVG 组元素但不在使用时

html - Bootstrap 自由职业者模板主题标签颜色覆盖不起作用