在我们的设计中,我们最终需要多列来显示带有省略号的标题,我不希望这些标题是一个大问题但是当它们嵌套在display: table计算中时似乎是不正确的.
需要注意的是,我们需要一个响应式布局,因此需要百分比宽度(固定宽度可以解决问题).我们的布局确实需要display: table更多的树,如果没有主要的重构,我无法删除它.
如果你删除显示屏,一切都按照我的预期运作:
但是,具有该显示会导致父级考虑预先截断的子元素总宽度(但考虑到nowrap).就好像初始渲染没有定义溢出一样,并在事后添加它(但到那时宽度计算太大了).
我可以猜测为什么渲染会破坏,但我想要一个关于浏览器渲染方式的更明确的答案......(在Mac上的Chrome/FF/Safari中测试过)
I am using d3 to make a chart with multiple paths. I am displaying the path(s) description on the left hand side. The data & descriptions are dynamic so the size of the legend is naturally also dynamic, since it is not a big deal as long as I know the size of the text (just a minor adjustment to the domain/range). The problem is that I do not see an easy way to find the size of the text …