ztawil
ztawil14mo ago

Is there a way to set the size the

Is there a way to set the size the markdown result box. I'd like to use hstack to have n boxes displaying markdown text. But sometimes the markdown text is long and so I think want to have a vertical scroll for that box and not have the box vary in width size.
7 Replies
ztawil
ztawilOP14mo ago
Myles Scolnick
Myles Scolnick14mo ago
For fixed height: it’s not that easy at the moment. For fixed width: I don’t think it has been released yet (currently on main) but next release you can do widths=“equal” in the hstack We could add fixed height to hstack but now you are susceptible to multiple scroll containers nested (the hstack and the app)
Akshay
Akshay14mo ago
We could have two additional functions on HTML: max_height() max_width() Then you could do hstack().max_height(“400px”)
ztawil
ztawilOP14mo ago
Thanks @Myles Scolnick and @Akshay
Akshay
Akshay14mo ago
Hi @ztawil ! We added an escape hatch in version 0.1.31 that allows you to apply a styled container to HTML elements. e.g. to enforce max-height:
import marimo as mo

mo.md("hello world\n\n" * 1000).style(
{"max-height": "200px", "overflow": "auto"}
)
import marimo as mo

mo.md("hello world\n\n" * 1000).style(
{"max-height": "200px", "overflow": "auto"}
)
Akshay
Akshay14mo ago
No description
ztawil
ztawilOP14mo ago
That's awesome. Thanks @Akshay