Bring Drag & Drop to Dash with Dashboard Engine. 💫 Learn how at our next webinar!

Rotate a Text Element

Hi Everyone! So I want to create a vertical and horizontal label for my Dash DataTable but for some reason I can’t seem to get the text to rotate. I tried:

html.H3(
    "sample text",
    style={
        "transform": "rotate(90deg);",
    }
)

but for some reason none of the methods that I’ve tried have allowed me to rotate the text. Thanks in advance for the help!

AFAIK you need to also add “postition”:“absolute” to your style declaration.

It’s always worth testing out what styles you need in the “Developer Tools” in chrome (Ctrl-Shift-I).

See https://divi.space/css-course/use-browsers-developer-tools-test-css-changes/ for more info.

1 Like

So what you had mentioned helped as well but I think the thing that kept throwing it off was the semicolon that I had placed in the string. I had just assumed that it would need that at the end because that’s what it’s like in CSS but I guess not. Thanks for the help!