Created
December 5, 2023 03:49
-
-
Save hansthen/8cab819ea5e2ef3c5329e00063dc5759 to your computer and use it in GitHub Desktop.
Customize styling for Aggrid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
from st_aggrid import AgGrid | |
import pandas as pd | |
df = pd.read_csv('https://raw.githubusercontent.com/fivethirtyeight/data/master/airline-safety/airline-safety.csv') | |
custom_css = { | |
".ag-row-even": {"background-color": "rgba(0,0,0,0.2) !important"}, | |
".ag-header-cell": {"background-color": "orange !important"}, | |
".ag-theme-streamlit": {"--ag-borders": "none", | |
"--ag-row-border-style": "none", | |
"--ag-cell-horizontal-border": "none"} | |
} | |
AgGrid(df, custom_css=custom_css) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment