在引导程序中打印时隐藏表格边框吗?

时间:2018-11-16 09:53:38

标签: html css twitter-bootstrap-3

我尝试设置css样式表以在每次为客户打印文档时删除边框,但是仍然显示表格边框。

这是我这样做的html脚本:

@media print {
  .table-bordered>thead>tr>th,
  .table-bordered>tbody>tr>th,
  .table-bordered>tfoot>tr>th,
  .table-bordered>thead>tr>td,
  .table-bordered>tbody>tr>td,
  .table-bordered>tfoot>tr>td {
    border: 0;
  }
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.js"></script>

<table class="table table-bordered">

  <tbody>
    <tr>
      <td style="width:25%;">
        លេខគណនី/ Account Number
      </td>
      <td style="width: 50%"> 0001</td>
      <td>
        <div class="checkbox">
          <label>
                            <input type="checkbox" value="" class="px">
                            <span class="lbl">ផ្ទេរចូល/ Transfer</span>
                        </label>
        </div>
      </td>
    </tr>
    <tr>
      <td>
        ឈ្មេាះគណនី / Account Name
      </td>
      <td> Jonh David</td>
      <td>
        <div class="checkbox">
          <label>
                            <input type="checkbox" value="" class="px">
                            <span class="lbl"> សាច់ប្រាក់ / Cash</span>
                        </label>
        </div>
      </td>
    </tr>
    <tr>
      <td>
        ចំនួនទឹកប្រាក់ជាលេខ / Amount in figure
      </td>
      <td>100,000.00 $ </td>
      <td>
        <div class="checkbox">
          <label>
                            <input type="checkbox" value="" class="px">
                            <span class="lbl"> មូលប្បទានបត្រ / Cheque/ Cash</span>
                        </label>
        </div>
      </td>
    </tr>
    <tr>
      <td>
        ចំនួនទឹកប្រាក់ជាអក្សរ / Amount in word
      </td>
      <td>100,000.00 $</td>
      <td>
        <div class="checkbox">
          <label>
                            <input type="checkbox" value="" class="px">
                            <span class="lbl"> មូផ្សេងៗ / Other </span>
                        </label>
        </div>
      </td>
    </tr>
    <tr>
      <div class="topAlign">
        <td colspan="2" valign="top" style="height:100px;">
          <p style="position:relative;top:-26px;"></p>
        </td>
      </div>
      <td valign="top">
        <p style="position:relative;top:-26px;">ប្រភេទសាច់ប្រាក់ / Denomination</p>
      </td>
    </tr>
  </tbody>
</table>

我不知道为什么这不适用于border属性,但是当我尝试使用另一个display:none;margin-left: 20px;之类的CSS属性时,它就可以正常工作。

我不知道这有什么问题,该怎么存档?

请帮助,谢谢

0 个答案:

没有答案