html - 表格填充在 chrome 中不起作用

标签 html css google-chrome

在过去的几天里,我一直在为这个表格苦苦挣扎,终于得到了我想要的结果,却发现文本对齐方式在 chrome 中无法正常工作。它准确地显示了我在 ie 和 firefox 中想要的方式(垂直对齐到中间并向左填充)但是它没有在 chrome 中显示。任何帮助都会很棒,我已经筋疲力尽了。

在 jfiddle ( http://jsfiddle.net/kaRev/ ) 中打开这两个。下图说明了我在两个浏览器(chrome 和 ff)之间遇到的问题。右侧的 Firefox 正确填充了它,而左侧的 chrome 没有

enter image description here

这是 chrome 的屏幕截图,其中表格中的文本太靠左了。

enter image description here

这是我想要的 firefox:

enter image description here

HTML:

<table class="tableBenefits">
<thead>
<tr>
          <th style="height:34px;width: 207px;font-weight:bold;color:#D2161C;" class="headneed">
      &nbsp Your Need        </th>
          <th style="height:34px;width: 166px;font-weight:bold;color:#D2161C;" class="headfeature">
      Feature        </th>
          <th style="height:34px;width: 260px;font-weight:bold;color:#D2161C;" class="headbenefits">
      Benefits   </th>

      </tr>
</thead>

<tbody >
      <tr class="row-mid">
              <td class="need">
        Notify technicians &amp; managers of work order status updates          </td>
              <td class="feature">
        Automated work order email notifications          </td>
              <td class="benefits">
        Keeps team updated on work order status; reduces admin time on work orders          </td>



          </tr>

  <tr class="row-mid">
              <td class="need">
        Notify service/repair requesters of progress          </td>
              <td class="feature">
        Automated service request email notifications          </td>
              <td class="benefits">
        Keeps requesters updated on progress; reduces personnel time for providing updates          </td>
          </tr>

  <tr class="row-mid">
              <td class="need">
        Manage &amp; track work orders          </td>
              <td class="feature">
        Work Order Forms, Linking, &amp; Routing          </td>
              <td class="benefits">
        Simplifies work order administration &amp; reduces data entry time          </td>
          </tr>

  <tr class="row-mid">
              <td class="need">
        Manage service &amp; repair requests          </td>
              <td class="feature">
        Web-based Service Request Form          </td>
              <td class="benefits">
        Simplifies request submission and routing          </td>
          </tr>
  </tbody>

CSS:

.tableBenefits thead {
background: url(http://www.mpulsesoftware.com/sites/all/themes/zen/image/top_eq.jpg) no-repeat;
}

.tableBenefits {
border-collapse: collapse;
border-spacing: 0;
}

.tableBeneits thead th {
font-weight:bold;color:#D2161C;
}

.tableBenefits {height:300px;width:640px;}

.headneed{font-weight:bold;font-size:11px;}
.headfeature{font-size:11px;}
.headbenefits{font-size:11px;}
.need{font-weight:bold;font-size:11px;text-align: left;padding-left: 10px;}
.feature{font-size:11px;text-align: left;padding-left: 10px;}
.benefits{font-size:11px;text-align: left;padding-left: 10px;}
.row-mid{background: url("http://www.mpulsesoftware.com/sites/all/themes/zen/image/middle_eq.jpg")repeat-y;width:640px;border-bottom:1px solid #ccc;}

.row-last{background: url("http://www.mpulsesoftware.com/sites/all/themes/zen/image/bottom_eq.jpg")repeat-y;width:640px;}



/* Webtk hack*/

@media screen and (-webkit-min-device-pixel-ratio:0) {




.tableBenefits td, .tableBenefits th {
  display: inline-table;

}

.headneed, .need{
  width: 207px;


}
.headfeature, .feature{
  width: 166px;

 }

.headbenefits, .benefits{
  width: 260px;

 }

}

/* End benefits table */

最佳答案

去掉这个display: inline-table;

关于html - 表格填充在 chrome 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12848178/

相关文章:

html - 悬停按钮时防止文本颜色发生变化

javascript - 为什么我的页面顶部和底部有黑白条?

html - 如何将一个 DIV 居中放置在另一个 DIV 的 RHS 上的剩余空间中

firefox - 溢出 :hidden works in Firefox but not in Chrome. 为什么?

html - 如何修复谷歌浏览器中错误的文本对齐方式 for rtl

html - 下拉菜单向上而不是向下出现

javascript - 使用 vanilla JS 对指向同一页面的链接做出不同的 react

javascript - Chrome 消息传递。 Uncaught Error : Error connecting to extension

javascript - HTML Canvas 矩形内的阴影效果

html - CSS - 元素不在 div 内保持内联