In layui development, the scrollbar, table header and table contents are not aligned because of the width of the scrollbar. Because the scrollbar has a separate patch column, comment out line 845 of the source code lay/modules/table.js
O = function (e) {/ / if (a & l) {/ / scroll bar in column and head alignment problem if (a) {if (((e = e.e q (0)),! e.find(".layui-table-patch")[0]) ) { var i = t( '<th class="layui-table-patch"><div class="layui-table-cell"></div></th>' ); i.find("div").css({ width: a, }), e.find("tr").append(i); } } else e.find(".layui-table-patch").remove(); };
CSS reduces the width of the patch column
th.layui-table-patch{ padding: 0 ! important; }