from bokeh.io import show
from bokeh.models import DataTable, TableColumn, ColumnDataSource, HTMLTemplateFormatter
# Note that the result of `toLocaleString()` depends on your locate
# so it will return different results for different users.
# If you REALLY need dots as thousands separates for every user
# regardless of locale, you can just format the value yourself
# however you see fit using JavaScript - there's plenty of examples online.
template = """\
<div style="background:<%= value < 0 ? 'red' : 'initial'%>;">
<%= value ? value.toLocaleString() : value %>
</div>"""
t = DataTable(columns=[TableColumn(title='X', field='x', formatter=HTMLTemplateFormatter(template=template))],
source=ColumnDataSource(data=dict(x=[-1.5, 0, 1.5])))
show(t)