下拉和按钮的高度不同。 dash绘图python

发布于 2025-01-27 12:34:18 字数 1261 浏览 3 评论 0原文

我正在尝试在Python中用仪表板制作仪表板,我正在尝试对齐2个下拉菜单,并且水平按钮

的html.div。

html.Div([
    html.Div(
        dcc.Dropdown(
            id='dropdown 1',
            options=list(df_.columns),
            multi=True,
            clearable=True,
            searchable=True,
            placeholder='Required Rows',
            optionHeight=20,
        ), style={
            'width': '39%',
            'display': 'inline-block',
            'vertical-align': 'top',
        }
    ),

    html.Div(
        dcc.Dropdown(
            id='dropdown 2',
            options=list(df_.columns),
            multi=True,
            clearable=True,
            searchable=True,
            placeholder='Required Columns',
            optionHeight=20,
        ), style={
            'width': '39%',
            'display': 'inline-block',
            'vertical-align': 'top',
        }
    ),

    html.Div(
        html.Button(
            "Do something",
            id='button_1',
        ), style={
            'width': '20%',
            'display': 'inline-block',
            'vertical-align': 'top'
        }
    )

]),

是我正在使用

执行某件事按钮,即使窗口正在调整大小时,也与下拉菜单相同。

还是

有什么方法可以使下拉列表的高度与按钮相同,即使在调整大小时也保持不变?

谢谢

I am trying to make a dashboard with dash in python and I am trying to align 2 dropdowns and a button horizontally

this is the html.Div that I am working with

html.Div([
    html.Div(
        dcc.Dropdown(
            id='dropdown 1',
            options=list(df_.columns),
            multi=True,
            clearable=True,
            searchable=True,
            placeholder='Required Rows',
            optionHeight=20,
        ), style={
            'width': '39%',
            'display': 'inline-block',
            'vertical-align': 'top',
        }
    ),

    html.Div(
        dcc.Dropdown(
            id='dropdown 2',
            options=list(df_.columns),
            multi=True,
            clearable=True,
            searchable=True,
            placeholder='Required Columns',
            optionHeight=20,
        ), style={
            'width': '39%',
            'display': 'inline-block',
            'vertical-align': 'top',
        }
    ),

    html.Div(
        html.Button(
            "Do something",
            id='button_1',
        ), style={
            'width': '20%',
            'display': 'inline-block',
            'vertical-align': 'top'
        }
    )

]),

enter image description here

Is there any way to make the height of the do something button the same as that of the dropdown even when the window is resizing.

Or

Is there any way to make the height of dropdowns same as that of the button, which stays the same even when resizing?

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

提赋 2025-02-03 12:34:18

您可以将元素设置为相同的line-Height

You can set the elements to the same line-height.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文