I think this is because the examples in the documentation are build with an older streamlit version and they changed the styling since.
You used to be able to check the streamlit version when pressing on “(view standalone Streamlit app)”, but they just changed the website with v1.1.0 and now it links to a static version where you can’t see the version anymore.
I remember having the same remark a few weeks ago and then I saw the examples were build with streamlit v0.86 or so.
Thanks @0phoff for your response. I had also suspected that streamlit version might be the cause. However, I tested with both 0.89.0 and 1.0.0 but they both had the same issue, that is, no background color for column and row headers.
Moreover, I test version 1.0.0 with df.style.format().set_table_styles([headers]) but it didn’t work either.