在 handsontable 中自定义 headers 上的文字换行

Wrap text on custom headers in handsontable

有没有办法在给定 colWidths 时自动换行 colHeaders 上的文本?它似乎不起作用,甚至禁止手动减小列的大小。

相关选项:

hot = new Handsontable(container, {
    data: items,
    startRows: 1,
    minSpareRows: 1,
    colHeaders: ['aaaaaaaa', 'bbbbbbb', 'cccccccccccc'],
    colWidths: [50,50,50]
    manualColumnResize: true,
    autoWrapRow: true
}

也许可以尝试将一些 CSS 添加到您的 headers:

.handsontable table thead th {
  white-space: pre-line;
  max-width: /* enter here your max header width */
}

尝试以下方法CSS:

.handsontable th {
    white-space: normal!important;
}

演示和来源:http://jsfiddle.net/cyancscoutrfp/hqLbg3rt/