user5711656
user5711656

Reputation: 3678

how to give full width to table cell in react + material?

I am using material UI with react .I am showing my data in table.Actually in table I have some titles example " GENERAL_INFORMATION" and INFORMATION are the titles .I want to show this in middle .But my table cell is not taking width 100% why ?

here is my code https://codesandbox.io/s/qlj0l8yrx9

 <Fragment>
                    <TableRow key={row.id}>
                      <TableCell> {title}</TableCell>
                    </TableRow>
                    {row.map(({ displaytext, value }) => (
                      <TableRow key={row.id}>
                        <TableCell>{displaytext}</TableCell>
                        <TableCell>{value}</TableCell>
                      </TableRow>
                    ))}
                  </Fragment>

I am taking help from this url https://material-ui.com/demos/tables/

Upvotes: 5

Views: 11560

Answers (1)

安博荣
安博荣

Reputation: 99

how about: https://codesandbox.io/s/wo9n5vvjvk

i just modify line:84

<TableCell colspan="2" style={{ "text-align": "center" }}>

Upvotes: 9

Related Questions