css - 如何解决边缘浏览器中的表格布局固定问题?
问题描述
在这里,我遇到了边缘浏览器的问题。使用表格布局:修复了它在 Firefox 和 chrome 浏览器中的工作正常。
我的情况就像我有下表:
<table class="slds-table slds-table--bordered slds-table--cell-buffer slds-max-medium-table--stacked-horizontal vlc-slds-table" ng-init=digestOnResize() ng-if="set.length">
<thead>
<tr class="slds-text-title_caps slds-text-heading--label">
<th width="20px" ng-style="{'padding':'0px'}"></th>
<th scope="col" ng-repeat='ctrl in set' ng-hide='!ctrl.displayInView'>
<div class="slds-truncate">{{::ctrl.eleArray[0].propSetMap.label}}</div>
</th>
<th width="70px"/>
</tr>
</thead>
<tbody class='vlc-slds-block_table-body'>
<tr>
<td>
<span class="vlc-asterix icon-v-asterix vlc-editblock-asterix" ng-if="isEditBlockRecordInvalid($index, this)"></span>
</td>
<td class='vlc-slds-block_table-body__td' data-label='{{::child.eleArray[0].propSetMap.label}}' ng-repeat='child in children = control.children' ng-hide='!child.displayInView'>
<form name="editblockform"
class="vlc-slds-edit-block__form"
ng-if='child.eleArray[0].propSetMap.hide||(!child.eleArray[0].propSetMap.show || evaluateShow(child.eleArray[0], this))'
ng-include="'vlcEditBlockDetailCont.html'">
</form>
</td>
<td data-label='{{::customLabels.OmniEditBlockTableMenu}}'>
<div class="vlc-slds-edit-block--button-menu">
<slds-dropdown content="[]" template-url="vlcEditBlockDropdown.html"></slds-dropdown>
</div>
</td>
</tr>
</tbody>
</table>
我正在为此使用css,如下所示:
.slds-table slds-table--bordered {
table-layout: fixed;
}
table td, .via-slds .slds-table th {
padding: .25rem .5rem;
white-space: nowrap;
position: relative;
}
但它不适用于边缘浏览器,其显示如下:
有人可以帮助我指导我如何解决它吗?
解决方案
不确定这是您要找的东西,我刚才遇到了同样的问题。在玩弄CSS
并寻找答案之后。我相信这是 Edge 的一个边缘情况,它会导致表格无法正确呈现,table-layout:fixed;
并且width:100;
我仍然不确定这如何为我解决这个问题,但明确地将桌子上的宽度设置为自动似乎可以解决问题。
推荐阅读
- jquery - 清除 BootstrapTable 中的过滤器值
- java - 编辑 JTextPane 的 paintComponent() 方法来改变 String 的颜色
- arrays - 如何从数组中生成所有偶数长度的子序列?
- python - 用于一般维数的多维网格
- excel - 为什么某些行而不是其他行的单元格公式不一致和损坏?
- r - How to add two different magnitudes of point size in a ggplot bubbles chart?
- c# - Xamarin.iOS - 合并多个视频时为每个视频设置音频采样率
- c++ - 后面如何存储和调用,不同类的成员函数,继承自同一个接口类
- qt - QTabBar QSS 样式
- spring - Grails插件:将列表注入doWithSpring中的bean