Fork me on GitHub


a minimalistic Excel-like data grid editor for HTML, JavaScript & jQuery

Custom HTML in cells and headers

On this page:

Rendering custom HTML in cells

This example shows how to use custom cell renderers to display HTML content in a cell.

This is a very powerful feature. Just remember to escape any HTML code that could be used for XSS attacks.

Rendering custom HTML in header

You can also put HTML into row and column headers.

If you need to attach events to DOM elements like the checkbox below, just remember to identify the element by class name, not by id. This is because row and column headers are duplicated in the DOM tree and id attribute must be unique.

For more examples, head back to the main page.

Handsontable © 2012 Marcin Warpechowski and contributors.
Code and documentation licensed under the The MIT License.