tabulator - How to align data in Tabulatorjs spreadsheet mode? - Stack Overflow

admin2025-04-18  3

I'm using spreadsheet feature from tabulator.js. I'd like to align data as in real spreadsheet (numbers to the right, text and dates to the left). Is there any way to do it with that library? My code is below.

var table = new Tabulator("#example-table", {
  spreadsheet:true,
  rowHeader:{field:"_id", hozAlign:"center", headerSort:false},
  spreadsheetData: [
    [' ', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
    ['08:00', 9937, 2123,   2321,   7749,   9816,   4355,   8279],
    ['09:00', 2380, 2345,   6977,   8896,   4012,   3803,   5408],
    ['10:00', 9180, 9021,   3912,   9445,   3917,   1200,   1837],
    ['11:00', 1924, 8734,   1819,   1838,   2330,   7921,   9219],
    ['12:00', 5434, 8665,   5875,   9732,   1926,   9999,   9743],
  ]
});
转载请注明原文地址:http://anycun.com/QandA/1744905876a89288.html