Grid layout
See original GitHub issueUsers sometimes want to lay items in a grid. For example:
image 1 | label 1 | score 1
image 2 | label 2 | score 2
image 3 | label 3 | score 3
The difference between a grid an a horizontal layout (Issue #241) is in a grid both the rows and the columns must line up.
And here’s a straw-man API for this feature:
grid = st.grid()
for image_info in image_info_list:
row = grid.row()
# Now you can use row.foo() to do the same as st.foo(), but
# the elements you insert will all go inside a horizontal
# container.
row.image(image_info.image)
row.text(image_info.label)
row.text(image_info.score)
…but this is just one of multiple possible APIs we could come up with here.
Everyone: what are other possible APIs?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:48
- Comments:24 (1 by maintainers)
Top Results From Across the Web
CSS Grid Layout - CSS: Cascading Style Sheets | MDN
CSS Grid Layout excels at dividing a page into major regions or defining the relationship in terms of size, position, and layer, ...
Read more >CSS Grid Layout Module - W3Schools
The CSS Grid Layout Module offers a grid-based layout system, with rows and columns, making it easier to design web pages without having...
Read more >A Complete Guide to CSS Grid
Introduction to CSS Grid. CSS Grid Layout (aka “Grid” or “CSS Grid”), is a two-dimensional grid-based layout system that, compared to any web ......
Read more >Usage examples of CSS Grid Layout - Grid by Example
To define a grid use new values of the display property `grid` or `inline-grid`. You can then create column and row tracks. View...
Read more >How to Use GridLayout (The Java™ Tutorials > Creating a ...
A GridLayout object places components in a grid of cells. Each component takes all the available space within its cell, and each cell...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
And here is my brainstorm on how a gridlayout could work. It’s included in the gallery at awesome-streamlit.org.
I might later improve it. The improved file can be found here
https://github.com/MarcSkovMadsen/awesome-streamlit/blob/master/gallery/layout_experiments/app.py
This looks pretty good, any updates on the plan for Streamlit to add in this feature?