Skip to content

Instantly share code, notes, and snippets.

@hansthen
Created December 5, 2023 03:49
Show Gist options
  • Save hansthen/8cab819ea5e2ef3c5329e00063dc5759 to your computer and use it in GitHub Desktop.
Save hansthen/8cab819ea5e2ef3c5329e00063dc5759 to your computer and use it in GitHub Desktop.
Customize styling for Aggrid
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