Spaces:
Running
Running
make tables in main responsive and center
Browse files
main.py
CHANGED
|
@@ -566,13 +566,19 @@ styled_table = (
|
|
| 566 |
:, new_dataset_comparison1.columns.difference(["TxT360"])
|
| 567 |
], # Apply to all columns except "TxT360"
|
| 568 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 569 |
.hide(axis="index") # Hide the row index
|
| 570 |
)
|
| 571 |
|
| 572 |
# Use _repr_html_() method to get the HTML representation of the styled DataFrame
|
| 573 |
table_html = styled_table._repr_html_()
|
| 574 |
# table_html = dataset_comparison1.to_html(index=False, border=0)
|
| 575 |
-
new_table_div_1 = Div(NotStr(table_html), style="margin: 40px;")
|
|
|
|
| 576 |
|
| 577 |
|
| 578 |
dataset_comparison1 = pd.DataFrame(
|
|
@@ -766,13 +772,19 @@ styled_table = (
|
|
| 766 |
],
|
| 767 |
axis=0,
|
| 768 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 769 |
.hide(axis="index")
|
| 770 |
) # Hide the row index
|
| 771 |
|
| 772 |
# Use _repr_html_() method to get the HTML representation of the styled DataFrame
|
| 773 |
table_html2 = styled_table._repr_html_()
|
| 774 |
# table_html2 = dataset_comparison2.to_html(index=False, border=0)
|
| 775 |
-
table_div_2 = Div(NotStr(table_html2), style="margin: 40px;")
|
|
|
|
| 776 |
|
| 777 |
dataset_sources = pd.DataFrame(
|
| 778 |
{
|
|
@@ -850,7 +862,7 @@ styled_table = (
|
|
| 850 |
)
|
| 851 |
.set_table_styles(
|
| 852 |
[
|
| 853 |
-
{"selector": "table", "props": [("margin-left", "auto"), ("
|
| 854 |
]
|
| 855 |
)
|
| 856 |
.hide(axis="index") # Hide the row index
|
|
|
|
| 566 |
:, new_dataset_comparison1.columns.difference(["TxT360"])
|
| 567 |
], # Apply to all columns except "TxT360"
|
| 568 |
)
|
| 569 |
+
.set_table_styles(
|
| 570 |
+
[
|
| 571 |
+
{"selector": "table", "props": [("margin-left", "auto"), ("width", "100%")]}, # Make table responsive and centered
|
| 572 |
+
]
|
| 573 |
+
)
|
| 574 |
.hide(axis="index") # Hide the row index
|
| 575 |
)
|
| 576 |
|
| 577 |
# Use _repr_html_() method to get the HTML representation of the styled DataFrame
|
| 578 |
table_html = styled_table._repr_html_()
|
| 579 |
# table_html = dataset_comparison1.to_html(index=False, border=0)
|
| 580 |
+
# new_table_div_1 = Div(NotStr(table_html), style="margin: 40px;")
|
| 581 |
+
new_table_div_1 = Div(NotStr(table_html))
|
| 582 |
|
| 583 |
|
| 584 |
dataset_comparison1 = pd.DataFrame(
|
|
|
|
| 772 |
],
|
| 773 |
axis=0,
|
| 774 |
)
|
| 775 |
+
.set_table_styles(
|
| 776 |
+
[
|
| 777 |
+
{"selector": "table", "props": [("margin-left", "auto"), ("width", "100%")]}, # Make table responsive and centered
|
| 778 |
+
]
|
| 779 |
+
)
|
| 780 |
.hide(axis="index")
|
| 781 |
) # Hide the row index
|
| 782 |
|
| 783 |
# Use _repr_html_() method to get the HTML representation of the styled DataFrame
|
| 784 |
table_html2 = styled_table._repr_html_()
|
| 785 |
# table_html2 = dataset_comparison2.to_html(index=False, border=0)
|
| 786 |
+
# table_div_2 = Div(NotStr(table_html2), style="margin: 40px;")
|
| 787 |
+
table_div_2 = Div(NotStr(table_html2))
|
| 788 |
|
| 789 |
dataset_sources = pd.DataFrame(
|
| 790 |
{
|
|
|
|
| 862 |
)
|
| 863 |
.set_table_styles(
|
| 864 |
[
|
| 865 |
+
{"selector": "table", "props": [("margin-left", "auto"), ("width", "100%")]}, # Make table responsive and centered
|
| 866 |
]
|
| 867 |
)
|
| 868 |
.hide(axis="index") # Hide the row index
|