tipsy / j2html

Java to HTML generator. Enjoy typesafe HTML generation.
https://j2html.com/
Apache License 2.0
765 stars 136 forks source link

Adding style to html element #199

Closed fpeluso closed 3 years ago

fpeluso commented 3 years ago

Hi guys, I was trying to add style to a single HTML element but it seems the style is completely ignored. Maybe I'm missing something?

The code I'm using:

table(
                tbody(
                        tr(attrs("#theader"),
                                td(
                                        b("someVariable")
                                ),
                                td(""),
                                td(
                                        "anotherVariable")
                        )
                ),
                tr(
                        td(
                                b("aVariable")
                        ),
                        td(""),
                        td(""),
                        style("#theader {margin-bottom: 100px;}")
                ),
                tr(
                        td("anInformation"),
                        td("anotherInfo"),
                        td("someRecap")
                )
        ).renderFormatted();

Hope this question is compliant with policies, thanks a lot if you could help

fpeluso commented 3 years ago

sorry guys, maybe I've found a solution