Before this is marked as duplicate, I have tried the code from the following topics and none has worked for me thus far:
[Colouring one column of pandas dataframe ]
If anyone is using BeautifulSoup to parse a website and then using pandas to create a DataFrame that you may want to add styles to, you can do something like:
(before using this you have already; imported beautifulsoup, scraped your site and created your dataframe)
variable_name = beautifulsoup(dataframe_name.to_html())
list = []
`for table in variable_name.findAll('table'):`
`for tbody in variable_name.findAll('table'):`
`for td in variable_name.findAll('tbody'):`
`list.append(td)`
list[td_index]['attribute_name'] = 'attribute_value'
This will add your all your table data to a list and you can select any element from that list and add/update a tag attribute
(if more efficient way please comment to help improve)