【问题标题】:CSS border-right doesn't show up in ChromeCSSborder-right 没有出现在 Chrome 中
【发布时间】:2014-06-17 11:19:45
【问题描述】:

我正在尝试在边框为 1px 的 tr 中显示 d3 条形图。它在 Firefox 中运行良好,但在 chrome 中,右边框没有出现!也许这是一个空间问题,或者我错过了一些东西。不管怎样,这是 tr 的代码(表格宽度为 1000px):

<table class="table table-condensed" style="border-collapse:collapse; width: 100%; padding-top: 10px;">
<tr style="border: 1px solid #DEDEDE;">
     <td colspan="6" class="hiddenRow" style="padding: 0 !important;">
        <div class="accordian-body collapse" style="font-size: 12px; padding-top: 5px; padding-bottom: 5px;" align="center" id="graphDiv1">
        </div>
     </td>
</tr>
</table>

这里是 d3 javascript 函数:

var margin = {top: 30, right: 150, bottom: 30, left: 50},
        width = 900 - margin.left - margin.right,
        height = 500 - margin.top - margin.bottom;

提前感谢所有帮助

【问题讨论】:

  • 使用该 HTML,右侧边框在 Chrome 中显示对我来说很好。您介意发布更多适用于此表的 CSS 吗?
  • 另外,您发布的 JavaScript 并不是很有帮助...您所展示的只是变量声明;实际上没有发生
  • ...所以最好展示一个在线示例,我们可以在其中看到效果。
  • @Interdasting 实际上,正在发生了一些事情。正在声明变量。

标签: javascript html css d3.js


【解决方案1】:

更改以下内容。

<table class="table table-condensed" style="border-collapse:collapse; width: 100%; padding-top: 10px;">

到...

<table class="table table-condensed" style="border-collapse:collapse; padding-top: 10px;">

您将表格的宽度设置为 100%,您的 javascript 应该已经定义了宽度。

【讨论】:

    猜你喜欢
    • 2014-05-27
    • 1970-01-01
    • 2020-03-20
    • 2014-12-21
    • 1970-01-01
    • 1970-01-01
    • 2020-06-14
    • 2020-08-02
    • 1970-01-01
    相关资源
    最近更新 更多