Closed Natanael1234 closed 8 years ago
Answer:
return (
<DataTable onClick = { onSelection }
style={{width: '80%', margin: 'auto'}}
shadow = { 0 }
rows = { cells } >
<TableHeader name = "id" >Id </TableHeader>
<TableHeader name = "nome" >Name </TableHeader>
<TableHeader name = "endereco" >Address </TableHeader>
<TableHeader name = "telefone" >Phone </TableHeader>
</DataTable>
,
It really depends on what you want to center. Your datatable example will indeed work to center a datatable.
For the example you mention in the first post, the article template, this is done because it used the Grid system. There is a 2 empty columns sized before the "main" part. Also, this system allows to automatically hide the 2 first columns when the view is in a "mobile" or "tablet" mode, to keep 100% width.
I found this example but don't found any source code showing how to implement.