mwouts / itables

Pandas DataFrames as Interactive DataTables
https://mwouts.github.io/itables/
MIT License
757 stars 56 forks source link

Center Align Table #22

Closed jatin-sandhuria closed 3 years ago

jatin-sandhuria commented 3 years ago

How do I center align the header and the rows within the table ? I have tried many things but nothing seems to be working.

mwouts commented 3 years ago

Hi I'll add one example to the README:

You can use the datatables.net cell classes like dt-left, dt-center, dt-right etc to set the cell alignment. Specify it for one table by using the columnDefs argument of show

show(df, columnDefs=[{"className":"dt-center",  "targets": "_all"}])

or globally by setting opt.columnDefs:

opt.columnDefs = [{"className":"dt-center", "targets": "_all"}]
df