こんな感じで
html
1<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css" />
2<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqgrid/5.8.8/css/ui.jqgrid.min.css" />
3<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
4<script src="https://cdnjs.cloudflare.com/ajax/libs/jqgrid/5.8.8/js/jquery.jqGrid.min.js"></script>
5<script>
6$(function(){
7 var data = [
8 {id:"1", name:"田中",smartphone :"◯",sensor:"◯"},
9 {id:"2", name:"斎藤",smartphone :"" ,sensor:"◯"},
10 {id:"3", name:"渡辺",smartphone :"◯",sensor:""},
11 ];
12
13 $("#grid01").jqGrid({
14 data: data ,
15 datatype: 'local',
16 colNames:['ID', '氏名', 'スマホ', 'センサー'],
17 colModel:[
18 {index:'id', name:'id', width:'80px', align:'right'},
19 {index:'name', name:'name', width:'80px', align:'left'},
20 {index:'smartphone', name:'smartphone', width:'100px', align:'left'},
21 {index:'sensor', name:'sensor', width:'100px', align:'left'},
22 ]
23 ,height:'auto'
24 });
25
26 $("#grid01").jqGrid('setGroupHeaders',{
27 useColSpanStyle: true,
28 groupHeaders:[
29 {startColumnName: 'smartphone', numberOfColumns: 2, titleText: '借用物'}
30 ],
31 });
32});
33</script>
34<table id="grid01"></table>