Custom CSS for Div Widget

Hello,

I’m trying to use the custom_css property introduced here: https://github.com/bokeh/bokeh/pull/5503. I have Bokeh 12.5.

I tried to follow this example from here: http://stackoverflow.com/questions/40981485/is-there-a-way-to-format-the-widgets-contents

No matter what I do, the CSS doesn’t seem to affect the table I’m creating for my div widget. The formatting stays the same.

My exact code is:

#div

jtext = “”"

{% for key,value in df.iterrows() %}

{% endfor %}

{{value['Rec_Number']}}: {{value['Recommendation']}}

“”"

t = Template(jtext)

html = t.render(df=output)

recDiv = Div(text=html)

recDiv.css_classes = [“rectable”]

I suspect I am not putting the css in the right place. I am putting it in my general css file for the page. Where exactly does the css go?

Any other help is appreciated. This feature isn’t documented very well, understandably since it is new.

Before anyone asks, I did try the data table widget but I don’t like how it presents the table (forcing each column to have the same size).

Hi,

···

On Sun, Apr 9, 2017 at 1:59 AM, Laura Suttle [email protected] wrote:

Hello,

I’m trying to use the custom_css property introduced here: https://github.com/bokeh/bokeh/pull/5503. I have Bokeh 12.5.

I tried to follow this example from here: http://stackoverflow.com/questions/40981485/is-there-a-way-to-format-the-widgets-contents

No matter what I do, the CSS doesn’t seem to affect the table I’m creating for my div widget. The formatting stays the same.

My exact code is:

#div

jtext = “”"

{% for key,value in df.iterrows() %}

{% endfor %}

{{value['Rec_Number']}}: {{value['Recommendation']}}

“”"

t = Template(jtext)

html = t.render(df=output)

recDiv = Div(text=html)

recDiv.css_classes = [“rectable”]

I suspect I am not putting the css in the right place. I am putting it in my general css file for the page. Where exactly does the css go?

Any other help is appreciated. This feature isn’t documented very well, understandably since it is new.

Before anyone asks, I did try the data table widget but I don’t like how it presents the table (forcing each column to have the same size).

this is a bug. Inheritance chain is broken for render() method in WidgetView and implementation of css_class in LayoutDOMView is never called. This affects all widgets.

Can you submit a bug report at github.com/bokeh/bokeh/issues?

Mateusz

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/b434069a-a1d2-474b-8bdf-6f13993d8d3c%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thank you for the confirmation that it’s a bug and not user error like I expected. I can submit a bug report tonight.

···

On Monday, April 10, 2017 at 10:19:01 AM UTC-4, mateusz.paprocki wrote:

Hi,

On Sun, Apr 9, 2017 at 1:59 AM, Laura Suttle [email protected] wrote:

Hello,

I’m trying to use the custom_css property introduced here: https://github.com/bokeh/bokeh/pull/5503. I have Bokeh 12.5.

I tried to follow this example from here: http://stackoverflow.com/questions/40981485/is-there-a-way-to-format-the-widgets-contents

No matter what I do, the CSS doesn’t seem to affect the table I’m creating for my div widget. The formatting stays the same.

My exact code is:

#div

jtext = “”"

{% for key,value in df.iterrows() %}

{% endfor %}

{{value['Rec_Number']}}: {{value['Recommendation']}}

“”"

t = Template(jtext)

html = t.render(df=output)

recDiv = Div(text=html)

recDiv.css_classes = [“rectable”]

I suspect I am not putting the css in the right place. I am putting it in my general css file for the page. Where exactly does the css go?

Any other help is appreciated. This feature isn’t documented very well, understandably since it is new.

Before anyone asks, I did try the data table widget but I don’t like how it presents the table (forcing each column to have the same size).

this is a bug. Inheritance chain is broken for render() method in WidgetView and implementation of css_class in LayoutDOMView is never called. This affects all widgets.

Can you submit a bug report at github.com/bokeh/bokeh/issues?

Mateusz

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/b434069a-a1d2-474b-8bdf-6f13993d8d3c%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.