HTML层
html的头部要添加上<html lang="en" xmlns:th="http://www.thymeleaf.org">
<link rel="stylesheet" href="/layui/css/layui.css">
<table id="changshang" lay-filter="changshang" style="width: 100%"></table>
<script src="/layui/layui.all.js" type="text/javascript"></script>
**<script th:inline="none" type="text/javascript">**
var changshang;
var layer;
var layuiTable, table;
$(function () {
layui.use(['layer', 'table'], function () {
layer = layui.layer;
layuiTable = layui.table;//
changshang = layuiTable.render({
elem: '#changshang',//html table id
url: "/changshangchaxun",//数据接口
cols: [[ //表头
{
type: 'radio', fixed: 'left', title: '选择', align: 'center', width: 10, hide: true},//单选框列,fixed:'left' 将列固定在左边
{
type: 'numbers', title: '序号', align: 'center', width: 100},//序号列,title设定标题名称
{
field: 'comanyid', title: 'comanyid', sort: false, fixed: 'left', hide: true}
, {
field: 'codingcs', title: '编码', width: 140, align: 'center'}
, {
field: 'comanyname', title: '厂商名称', align: 'center', sort: true}
, {
field: 'production', title: '生产标记', align: 'center'}
, {
field: 'dealerbiaoshi', title: '经销商标记', align: 'center'}
, {
field: 'settlementmarkers', title: '结算方式', align: 'center'}