反应台默认高度问题和自适应样式

问题描述 投票:0回答:1

我正在使用带有可滚动列和标题的react-table-类似于https://codesandbox.io/s/kowzlm5jp7?file=/index.js:281-310

我在表格样式中设置高度,例如

        <ReactTableFixedColumns
            showPagination={false}
            defaultPageSize={selectedItemsLength}
            data={selectedItems}
            style={{height: "73vh"}}
            className="-striped -highlight"
            columns={[

因此,当我仅选择1或2个项目表时,这个问题看起来很严重

table with one item selected

[当我使用73vh时-看起来不错,但仅在我的屏幕(Ubuntu chrome)上,并且我选择了10-15个以上的项目。如果更少,则将其拉伸。

由于某些原因,在Mac上的chrome或safari上,看不到滚动条。

我真的把桌子弄乱了,有什么解决方案可以使react-table在许多设备上看起来漂亮,或者至少不扩展1或2​​个项目吗?

感谢任何人的友好回应

css reactjs react-table
1个回答
0
投票

我通过]进行了拉伸>

    .ReactTable .rt-thead {
    flex: none !important;
}

.ReactTable .rt-tr {
    flex: none !important;
}

.ReactTable .rt-tr-group {
    flex: none !important;
}

仍然不知道如何使桌子在Mac和Ubuntu上看起来很漂亮-我应该设置什么高度

© www.soinside.com 2019 - 2024. All rights reserved.