html - 表格单元格中的非均匀虚线边框

标签 html css border css-tables

我在 HTML 表格单行的几个连续单元格上应用了 CSS border-bottom:1px dashed #494949;,但边框不统一。每个单元格末尾的破折号看起来稍长。虚线边框也不统一。我也在使用 border-collapse:collapse;

截图如下:

enter image description here

有什么方法可以获得统一的虚线边框吗?

最佳答案

我在我的应用程序中解决此问题的方法是添加一个额外的行,该行与带有虚线边框的行具有相同的 colspan。边界将与跨度的长度一致:

<table>
    <!--row with dashed border-->
      <tr>
          <td style = "border-bottom: 1px dashed green;" colspan="3"></td>
      </tr>
    <!--added row so dotted border looks uniform-->
      <tr>
          <td style="height: 5px;" colspan="3"></td>
      </tr>
    <!--existing rows with lots of columns-->
      <tr>
          <td></td>
          <td></td>
          <td></td>
      </tr>
</table>

关于html - 表格单元格中的非均匀虚线边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9786963/

相关文章:

html - WYGWAM 文本编辑器覆盖 ExpressionEngine 中的 CSS 设置

css - Bootstrap Internet Explorer 显示本地和远程

css - 如何使用 flex 证明 div child 的合理性

css - 如何将顶部边框放在仅覆盖 css 中的字母的标题上

html - CSS显示:block not working

javascript - Protractor - 识别 Ui-Sref 链接

java - 无法更改布局边框颜色

css - 边框和等高 css 列

javascript - 用这个。在 Angular 不起作用?

iphone - 如何在网络应用程序中控制 iPhone 的屏幕方向