Handsontable支持自定义的单元格类型,查看官方自定义渲染文档说明地址,修改出需要的数据显示类型。
单元格类型自定义的代码:
function safeHtmlRenderer(instance, td, row, col, prop, value, cellProperties) {
var escaped = Handsontable.helper.stringify(value);
escaped = strip_tags(escaped, '<em><b><strong><a><big>'); //be sure you only allow certain HTML tags to avoid XSS threats (you should also remove unwanted HTML attributes)
td.innerHTML = escaped;
return td;
}
handsontable设置自定义类型的代码: