react+antd 渲染table内容时, 屏幕高度被拉长了。

使用react+antd做一个简单项目时,向以下代码中的Table做了记录的重绘,所有的布局的height和width都采用了百分比的方式,table里面的资料少时,界面正常,记录一多,内容高度大与div高度时,界面就被拉伸了,我给table设置了自动滚轮,拉伸的目测是外边整个div的高度,何解?
<Row style={{background: '#ddf2da',height: '77.5%'}}>

<Col span="16" style={{background: '#fff',height: '100%'}}>
 <Row type="flex" justify="center" style={{background: '#7ed37a', height: '7.5%' }}>
   <Col><h2>查询结果</h2></Col>
 </Row>
<div style={{overflow:"auto",background: '#fff', height:'92.5%'}}>
     <Table  columns={columns} dataSource={this.state.dataLst} />
 </div>

</Col>

<Col span="8"  style={{background: '#fff',height: '100%'}}>
  <Row style={{background: '#52f',height: '75%'}}>
     <Col span="24">
     </Col>
  </Row>
  <Row style={{background: '#fff',height: '25%'}}>
     <Col span="24">
     </Col>
  </Row>

</Col>
</Row>

阅读 5.3k
1 个回答

<Table columns={columns} dataSource={data} scroll={{ y: 你需要的高度 }}

多看文档

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题