jquery - 表格布局固定在 html 表格上不起作用
问题描述
我想让所有单元格都具有相同的widtd。我正在使用 jsgrid 默认的 table-layout:fixed 但没有任何反应。
list_activity.jsGrid({
height: "90%",
inserting: false,
editing: false,
filtering: false,
width: "100%",
paging: true,
autoload: true,
pageSize: 4,
data: [],
})
解决方案
定义每个 colModel
$("#grid").jqGrid({
datatype: "local",
height: 250,
colNames: ['Inv No', 'Thingy', 'Blank', 'Number', 'Status'],
colModel: [{
name: 'id',
index: 'id',
width: 60,
sorttype: "int"},
{
name: 'thingy',
index: 'thingy',
width: 60,
sorttype: "date"},
{
name: 'blank',
index: 'blank',
width: 60},
{
name: 'number',
index: 'number',
width: 60,
sorttype: "float"},
{
name: 'status',
index: 'status',
width: 60,
sorttype: "float"}
],
caption: "Stack Overflow Example",
// ondblClickRow: function(rowid,iRow,iCol,e){alert('double clicked');}
});
推荐阅读
- azure-container-registry - 从 microk8s 连接到 Azure 容器注册表
- mysql - 在同一张表上加入外键并显示父母和孩子
- ios - 如何忽略原生错误 IOS react native
- c# - 如何在没有 app.xaml 的情况下设置 MessageBox(扩展工具包)的样式
- ruby - 使用正则表达式在 Sinatra 和 Rack 中定义静态路由
- android - 字节数组不存储在 Android 的对象中?
- highcharts - 我如何在 highcharts 的工具提示中设置 xAxis 的实际值
- flutter - 必须初始化不可为空的实例字段“taskTitle”
- arrays - 在 Leetcode 上基于摩尔斯电码的“简单”问题中需要的建议
- angularjs - ng serve 命令出错[。发生未处理的异常:脚本文件 node_modules/jquery/dist/jquery.min.js 不存在。]