Handsontable utilizes the HTML table structure so customization is based either on referencing to the already existing elements, such as TR/TD, or by applying your own CSS classes to HTML elements.
A cell can be formatted either using a CSS class or with a style applied directly to the DOM element.
In this example, we add a custom class custom-cell to the cell in the top left corner and add a custom-table CSS class that highlights the table headers.
const container = document.querySelector('#example1');const hot =newHandsontable(container,{data: Handsontable.helper.createSpreadsheetData(5,5),rowHeaders:true,colHeaders:true,stretchH:'all',className:'custom-table',cell:[{row:0,col:0,className:'custom-cell',},],height:'auto',licenseKey:'non-commercial-and-evaluation',});
To enable the custom borders feature, set the customBorders option. This can either be set as true or initialized as an array with a pre-defined setup. For the list of available settings and methods, visit the API reference.
In the names of the API properties, the words start and end refer to the starting and ending edges of the layout direction.
WARNING
The start and end properties used to be called left and right before Handsontable 12.0.0. The old names left and right work in the LTR layout direction but throw an error when the layout direction is set to RTL.
const container = document.getElementById('example3');const hot =Handsontable(container,{data: Handsontable.helper.createSpreadsheetData(5,6),rowHeaders:true,colHeaders:true,stretchH:'all',height:'auto',licenseKey:'non-commercial-and-evaluation',customBorders:[{range:{from:{row:1,col:1},to:{row:3,col:4}},top:{width:2,color:'#5292F7'},bottom:{width:2,color:'red'},start:{width:2,color:'orange'},end:{width:2,color:'magenta'}},{row:2,col:2,start:{width:2,color:'red'},end:{width:1,color:'green'}}]});