【发布时间】:2021-11-11 03:40:23
【问题描述】:
我必须水平对齐使用地图函数渲染的组件,因为它的默认垂直对齐。
这是我的组件:
<Table.Cell>
{[...Array(this.props.numPages)].map((e, i) => (
<Typography customLink onClick={() => this.handlePageClick(i + 1)} key={'key'.concat(i)} className='pages'>
{i + 1}
</Typography>
))}
</Table.Cell>
这里Typography 是必须呈现为页码但它会垂直呈现的组件。
这是我使用的 css:
.pages{
display: flex;
flex-direction: horizontal;
}
我们将不胜感激。
【问题讨论】:
标签: javascript html css arrays reactjs