python - 破折号:如何扩展组件以填充剩余的水平和垂直空间
问题描述
我有一些 div、按钮和下拉菜单,我想填充剩余的可用空间?我怎么能做这样的事情?
一个例子是:
import dash
import dash_bootstrap_components as dbc
app = dash.Dash(external_stylesheets=[dbc.themes.CERULEAN])
app.layout = \
dbc.Container \
([
dbc.Row([
dbc.Col
([
dbc.Row([dbc.Button("Graph here", style={"width": "100%"})]), # make this fill the available height
dbc.Row([dbc.Button("Load file", style={"width": "50%"}), dbc.Button("Load a different file") # make this button fill available width]),
], width=9),
dbc.Col
([
dbc.Row([dbc.Button("Choose data", style={"width": "100%"})]),
dbc.Row([dbc.Button("Change graph", style={"width": "100%"})]), # make this fill available height
], width=3)
])
], fluid=True)
if __name__ == "__main__":
app.run_server(debug=False, port=8050)
解决方案
推荐阅读
- flutter - 在“extensionRPCs”中找不到“ext.flutter.driver” - 会是什么问题?
- ruby-on-rails - 为什么我需要在 Ruby on rails 应用程序中包装线程?
- javascript - html中的列表转到下一行留下空白
- firebase - Firebase 托管缓存 Google Cloud Run 请求
- pdf - Android相机,拍照并保存为多页PDF,然后通过以下方式上传到服务器
- ruby-on-rails - Postgresql 10 逻辑复制 - 同步副本数据库表的最佳方法是什么
- excel - How to keep the last row of a matching string in excel
- android - 以下文件关联已恢复。它们在项目中注册为 DDL 文件类型
- android - Room cannot migrate database
- javascript - 带有 Ant Design 的响应式 Sider