答案 0 :(得分:1)
感谢大家的关注。这很容易,但是以前没有找到。 我在材料表标记中添加了一个选项
options={{
search: true,
actionsColumnIndex: -1,
toolbarButtonAlignment:"left" // here is the option to change toolbar buttons' alignment
}}
答案 1 :(得分:1)
您可以通过覆盖工具栏组件来代替使用actions
属性。以下是components
上所需的<MaterialTable />
属性的示例代码,您可以根据需要更改样式和组件:
components={{
Toolbar: (toolbarProps) => (
<Box display="flex" alignItems="center">
<Button
style={{ marginLeft: '8px', marginRight: 'auto' }}
variant="contained"
color="secondary"
>
Refresh
</Button>
<MTableToolbar {...toolbarProps} />
</Box>
),
}}