There is an extra blank column at the end of the layui table table

There is one more blank column at the end of the layui table table, as shown in the red box part:

 Solution one:

Modify the css style as follows:

.layui-table-view .layui-table {
    width: 100% !important;
}

.layui-table th {
    text-align: -webkit-center !important;
}

The effect is as follows:

 It is obvious that there is no alignment.

Solution two:

Modify the style in the done method after the table is rendered, as follows:

done: function(e){
    $('.layui-table').css("width", "100%");
    $("th[data-field='delete']").css("border-right", 'none');
}

Can solve the blank problem of the last column.

The road is long and long, I will search up and down!

Guess you like

Origin blog.csdn.net/weixin_38817361/article/details/127810480