修改表格,等样式

This commit is contained in:
黄焱
2024-01-05 14:10:43 +08:00
parent 5b9b700372
commit e29883d0de
8 changed files with 107 additions and 8 deletions

View File

@@ -0,0 +1,28 @@
function setTableWidth() {
let timer = null
const dom = $('.o_list_renderer ')
if(!dom.length) {
timer = setTimeout(setTableWidth, 500)
return
}
const widthTest = '<span id="widthTest" style="width: fit-content"></span>'
$('body').append(widthTest)
clearTimeout(timer)
const tbody_tr = dom.find('tbody').children('tr')
dom.find('thead').children('tr').children().each(function () {
$('#widthTest').text($(this).text())
const width = $('#widthTest').width()
const i = $(this).index()
console.log(111)
tbody_tr.each(function () {
if($(this).children().length > 2) {
$(this).children().eq(i).css('min-width', width + 'px')
}
})
})
}
$(function () {
setTableWidth()
})