@@ -231,7 +231,7 @@ function loadJSONTableData() {
231
231
} ) ) ;
232
232
}
233
233
234
- function dataToTable ( data , columnOrder , filterColumns , domSetting ) {
234
+ function dataToTable ( data , columnOrder , filterColumns , domSetting , rotateTable ) {
235
235
let table = document . createElement ( 'table' ) ;
236
236
let columnFilter = data . columns . map ( ( k , i ) => filterColumns ?. [ k ] ) . map ( f => {
237
237
if ( ! f )
@@ -258,6 +258,9 @@ function dataToTable(data, columnOrder, filterColumns, domSetting) {
258
258
table . classList . add ( 'table' , 'table-striped' , 'table-sm' ) ;
259
259
table . innerHTML = '<thead><tr></tr><tr class="filters"></tr></thead><tbody></tbody>'
260
260
261
+ if ( rotateTable )
262
+ table . classList . add ( 'rotate' ) ;
263
+
261
264
columnOrder . forEach ( colSrcIdx => {
262
265
let th = document . createElement ( 'th' ) ;
263
266
@@ -267,11 +270,15 @@ function dataToTable(data, columnOrder, filterColumns, domSetting) {
267
270
}
268
271
269
272
th . classList . add ( `toh_${ data . columns [ colSrcIdx ] } ` ) ;
270
- th . style . maxWidth = 0 ;
271
- th . style . minWidth = '3em' ;
272
- th . style . whiteSpace = 'nowrap' ;
273
- th . style . overflow = 'hidden' ;
274
- th . style . textOverflow = 'ellipsis' ;
273
+
274
+ if ( ! rotateTable ) {
275
+ th . style . maxWidth = 0 ;
276
+ th . style . minWidth = '3em' ;
277
+ th . style . whiteSpace = 'nowrap' ;
278
+ th . style . overflow = 'hidden' ;
279
+ th . style . textOverflow = 'ellipsis' ;
280
+ }
281
+
275
282
table . firstElementChild . firstElementChild . appendChild ( th ) ;
276
283
277
284
let filter = document . createElement ( 'th' ) ;
@@ -351,7 +358,7 @@ function initToH() {
351
358
catch ( e ) { console . error ( 'Error parsing ToH settings: ' + e ) ; }
352
359
353
360
profile ??= { } ;
354
- profile . source ??= 'min ' ;
361
+ profile . source ??= 'json ' ;
355
362
356
363
let loadSource ;
357
364
switch ( profile . source ) {
@@ -402,7 +409,8 @@ function initToH() {
402
409
403
410
const domSetting = profile ?. dom ?? 'lfrtip' ;
404
411
const columnOrder = shownColumns . map ( colName => srcData . columns . indexOf ( colName ) ) ;
405
- let table = $ ( dataToTable ( srcData , columnOrder , filterColumns , domSetting ) ) ;
412
+ const rotateTable = profile ?. rotate ?? false ;
413
+ let table = $ ( dataToTable ( srcData , columnOrder , filterColumns , domSetting , rotateTable ) ) ;
406
414
407
415
$ ( wrapper ) . hide ( ) . empty ( ) . append ( table ) ;
408
416
$ ( wrapper ) . find ( 'table' ) . DataTable ( {
0 commit comments