BootStrapTable.js 表头与内容无法对齐

去掉 height 属性的配置即可保证数据表格的表头部分与数据部分对齐。

代码详例如下:

$(function () {
        $("#serviceTable").bootstrapTable({
            // for the Name of Package then appended system
            url:'/service/ServiceList.action',
//            height: 500,
            dataType: "json",
            striped: true,//row color
            cache: false,
            undefinedText: "-",
            sortName: "serviceId",
            sortOrder: "asc",
            pagination: true,
            sidePagination: "server",
            toolbar: "#toolbar",
            pageNumber:1,
            pageSize:5,
            pageList:[5,10,25,50],
            paginationPreText: "上一页",
            paginationNextText: "下一页",
            columns: [{
                checkbox: true
            }, {
                field: "serviceName",
                title: "权益名称",
                align: 'center'
            },{
                field: 'serviceId',
                title:'操作',
                align:'center',
                formatter:function(value,row,index){
                    var serviceId = row.serviceId;
                    var a = '编辑';
                    return a;
                }
            }]
        });
    });




你可能感兴趣的:(BootStrap,教程,jQuery,入门,JS入门)