how to set alignment of each dropdown widget in jupyter

Solutions on MaxInterview for how to set alignment of each dropdown widget in jupyter by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "how to set alignment of each dropdown widget in jupyter"
Laura
23 Jun 2020
1from ipywidgets import Layout, Button, Box
2
3items_layout = Layout( width='auto')     # override the default width of the button to 'auto' to let the button grow
4
5box_layout = Layout(display='flex',
6                    flex_flow='column',
7                    align_items='stretch',
8                    border='solid',
9                    width='50%')
10
11words = ['correct', 'horse', 'battery', 'staple']
12items = [Button(description=word, layout=items_layout, button_style='danger') for word in words]
13box = Box(children=items, layout=box_layout)
14box
15