plotly - DataTable (inline-block) 和 Dash 中的任何 html、dcc 元素的问题
问题描述
我正在使用 Dash 创建具有此布局的 Web 仪表板:
app.layout = html.Div([
html.H1("DashBoard Bonos Buenos Aires", style={'text-align': 'center'}),
html.Div(
className='row',
children=[
html.Div([
html.Div([
html.H2("Esquemas", style={'text-align': 'center'}),
dash_table.DataTable(
id='EsquemasBonos',
columns=[{"name": i, "id": i} for i in Gasto.columns],
data=Gasto.to_dict('records'), style_table={'overflowY': 'scroll'})
], style={'height': '300px', 'overflow': 'scroll'}),
html.Div([
html.H2("TablaTotal", style={'text-align': 'center'}),
dash_table.DataTable(
id='TablaTotal',
columns=[{"name": i, "id": i} for i in GastoTotal.columns],
data=GastoTotal.to_dict('records'), style_table={'overflowY': 'scroll'})
]),
html.Br(),
html.Div([
html.H2("Tabla Full", style={'text-align': 'center'}),
dash_table.DataTable(
id='TablaFull',
columns=[{"name": i, "id": i} for i in PorDriverID1.columns],
data=PorDriverID1.to_dict('records2'), style_table={'overflowY': 'scroll'})
], style = {'width': '100%', 'height': '500px', 'overflow': 'scroll'}),
], style={'width': '50%', 'display': 'inline-block'}),
html.Div([
html.H2("Gasto por Esquema", style={'text-align': 'center'}),
dcc.Graph(id='Gasto', figure=fig)
], style={'width': '50%', 'display': 'inline-block',}),
]),
])
我想在屏幕的一半上显示表格,在另一半上显示图表。但由于某种原因,我不明白这是输出。
我希望图表和表格处于同一水平。我已经尝试过使用内联块,但我似乎无法将图形和表格放在同一“行”上。
解决方案
我也遇到了这个问题,在保存表格的 HTML div 中使用“style={'overflow':'auto'}”为我修复了它。
推荐阅读
- google-apps-script - 如何通过 Google Script 在 Google Apps 上检索 Google Apps USER SUSPEND 日期?
- php - “调用未定义函数 App\Http\Controllers\Auth\veiw()”
- asp.net-mvc - 无法从以下位置获取配置:“http://www.example.com:8080/openam/.well-known/openid-configuration”
- c++ - 是否可以在邻接列表中删除我的 Boost Graph 中的顶点?
- c# - 丑陋的边框在设计时出现,但在运行时其固定在 Winform
- macos - 自定义引导加载程序找不到内核
- javascript - 如何设置映射输入的嵌套 JSON 数组对象的状态
- reactjs - 使用 React 将 BlockBlob 上传到 Azure 存储
- if-statement - 如何用文件中的另一个单词替换以某事物结尾的单词
- javascript - 恢复切换(按钮)状态而不会陷入循环