【问题标题】:Table pagination + table styles - how to get rounded edges on the last displayed row表格分页 + 表格样式 - 如何在最后显示的行上获得圆角边缘
【发布时间】:2019-02-06 02:50:07
【问题描述】:

我的网站上显示了一个分页表格。 我引用了这个问题的第一个答案:Show N rows per page in HTML table 来弄清楚如何进行分页。

问题是我的表格是这样设计的:

table tr:first-child th:first-child {
    border-top-left-radius: 40px;
}

table tr:first-child th:last-child {
    border-top-right-radius: 40px;
}

table tr:last-child td:first-child {
    border-bottom-left-radius: 40px;
}

table tr:last-child td:last-child {
    border-bottom-right-radius: 40px;
}

这样做的效果是整个表的每个“角”都是圆的。我希望分页表也有圆角 - 但是,我似乎无法修改分页代码以在底部两个角添加圆角样式。我真的被困住了。

感谢任何帮助!如果您需要更多信息,请告诉我。

这里举个例子:https://jsfiddle.net/hermana/8nou03tc/37/

例如,当我将行数设置为 5 时,我希望显示的最后两行显示为四舍五入。

【问题讨论】:

  • 任何小提琴/sn-p?
  • “分页表”是什么意思?你能提供一个工作演示的链接吗?
  • @Mukyuu 谢谢-我创建了一个小提琴并在上面更新了:)
  • @AndyHoffman 谢谢你,我在上面添加了一个小提琴的链接
  • 嘿@ellen,我解决了这个here。我直接将边框半径应用到table,然后在桌子上设置overflow: hidden

标签: jquery css pagination css-tables


【解决方案1】:

@AndyHoffman 在 cmets 中回答了这个问题。请参阅此fiddle

table {
  background-color: black;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-bottom-right-radius: 8px;
  border-bottom-left-radius: 8px;  
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-28
    • 1970-01-01
    • 2022-01-04
    • 2021-02-15
    • 1970-01-01
    • 2017-10-16
    相关资源
    最近更新 更多