// Handsontable 방식
Handsontable.renderers.registerRenderer('statusRenderer', (hot, TD, row, col, prop, value) => {
TD.style.color = value > 0 ? 'green' : 'red';
TD.innerText = value;
});
// SpreadJS 방식 — CellType 클래스 상속
function StatusCellType() { GC.Spread.Sheets.CellTypes.Base.call(this); }
StatusCellType.prototype = Object.create(GC.Spread.Sheets.CellTypes.Base.prototype);
StatusCellType.prototype.paint = function(ctx, value, x, y, w, h) {
ctx.fillStyle = value > 0 ? '#2E7D32' : '#C62828';
ctx.fillText(value, x + w / 2, y + h / 2);
};
sheet.getCell(0, 0).cellType(new StatusCellType());