import pandas as pd
from IPython.display import HTML
import seaborn as sns
# Load the Iris dataset
iris = sns.load_dataset("iris")
# Define a function to style the header cells and rows with accent color and Tahoma font
def style_dataframe(df, header_background_color="#5F497A", header_text_color="white", content_text_color="black"):
styles = [
{"selector": "thead th", "props": [("background-color", header_background_color), ("color", header_text_color), ("font-weight", "bold"), ("font-family", "Tahoma, sans-serif"), ("font-size", "11px")]},
{"selector": "tbody tr:nth-child(odd)", "props": [("background-color", "#f9f9f9")]},
{"selector": "tbody tr:nth-child(even)", "props": [("background-color", "white")]},
{"selector": "tbody td", "props": [("border", "1px solid lightgray"), ("font-family", "Tahoma, sans-serif"), ("font-size", "10px"), ("color", content_text_color)]},
]
return df.style.set_table_styles(styles).hide(axis="index")
# Apply the custom style function
styled_iris = style_dataframe(iris.head(5))
# Display the styled DataFrame using the IPython display function
styled_iris