ECSide标签<ec:table>表格对不齐问题处理

现象如下图

处理方式如下

javascript 复制代码
<ec:table styleClass="dynamic-table"> /* 为表格添加如下样式 */

</ec:table>



<style>
.dynamic-table {
    table-layout: fixed !important; /* 关键:防止列宽自适应破坏布局 */
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 0 auto; /* 居中显示 */
    white-space: normal !important; /* 确保子元素可换行 */
}

.dynamic-table th, 
.dynamic-table td {
    border: 1px solid #ddd !important; /* 统一边框 */
    padding: 8px !important;           /* 内边距一致 */
    text-align: center !important;    /* 文本居中 */
    word-wrap: break-word !important;  /* 长文本换行 */
    overflow-wrap: break-word !important; /* 现代浏览器优先 */
    max-width: 100% !important; /* 强制内容最大宽度不超过单元格 */
    text-wrap-mode: wrap;
}
</style>

处理后效果如下

相关推荐
紫麦熊2 小时前
react+ts+vite+tailwind+shadcn
1024程序员节
日日行不惧千万里2 小时前
MediaMTX详解
1024程序员节
yqcoder5 小时前
在 scss 中,&>div 作用
前端·css·scss
小马哥编程5 小时前
这个variables.scss文件中$menuText:#bfcbd9;:export {menuText: $menuText; }的语法符合要求吗
前端·css·scss
爆浆麻花6 小时前
为什么有些人边框不用border属性
前端·css
金融小师妹6 小时前
基于LSTM-GARCH模型:三轮黄金周期特征提取与多因子定价机制解构
人工智能·深度学习·1024程序员节
www_stdio7 小时前
用 localStorage 打造本地待办清单:一个轻量级的前端实践
javascript·css·json
光影少年7 小时前
css影响性能及优化方案都有哪些
前端·css
stormsha10 小时前
CSS 样式美学从基础语法到界面精筑的实战宝典
前端·css·postcss·设计语言
yqcoder10 小时前
css 中,backdrop-filter: blur(10px) 作用
前端·css