css - 表内的时间选择器

标签 css angular ngx-bootstrap

在我的 Angular 应用程序中,我使用 timepicker来自ngx-bootstrap的小部件.

在 table 外使用时看起来不错:

enter image description here

但是,由于某些原因,在 table 元素中使用时它看起来非常丑陋:

enter image description here

我没有使用任何自定义 CSS 代码。

最佳答案

我花了一段时间才弄清楚那里发生了什么。问题是附加到 .table 的一些引导样式和类似的类(例如应用于 .table td 的规则)破坏了时间选择器的布局(因为它内部也使用 >table 元素)。

我的解决方案是应用这种风格:

timepicker {
  table {
    tr {
      background-color: transparent !important;

      th,
      td {
        padding: 0 !important;
        vertical-align: middle !important;
        border: none !important;
      }
    }
  }
}

关于css - 表内的时间选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52483139/

相关文章:

node.js - 未满足的同伴依赖性问题

angular - Ngx-Bootstrap 和 Angular 9 ModuleWithProviders 错误

javascript - 日期输入显示前一天的值

css - 列、变换和像素舍入问题

html - 如何制作 Bootstrap 下拉菜单的垂直滚动条

jquery最小宽度计算(加法)

c# - 使用 Angular 6 将文件上传到 Web Api C#

angular - 无法动态显示数据表中的数据。 ( Angular 6)

css - 如何在 react 样式组件中添加 'title' 标签(用于工具提示)

javascript - JS/Angular - 找出父元素的宽度/高度内有多少 html 元素