Open Ben-Epstein opened 1 year ago
I think sl.Table would be great, especially if It could come from a pandas dataframe (or list of dictionaries etc).
sl.Table
Currently, I need to do this to get a decent centered table
html = (f""" <table class='center' height="50%" width="100%" align=center cellpadding ="25"> <tr> <th><h2>Question</h2></th> <th><h2>Answer</h2></th> </tr> {get_table_rows()} </table> """ )
and then a get_table_rows helper function thats like this
get_table_rows
def get_table_rows() -> str: table_rows = "" for question in State.history.value: table_rows += f"<tr>\n\t<td>{question.q}</td>\n\t<td>{question.a}</td>\n</tr>" return table_rows
It would be awesome if I could have a simple styled centered table from an object sl.Table(my_data)
sl.Table(my_data)
Do you think it makes sense to implement this using https://solara.dev/api/dataframe but giving some options to remove some of the 'chrome' (pagination, stripes)
I think
sl.Table
would be great, especially if It could come from a pandas dataframe (or list of dictionaries etc).Currently, I need to do this to get a decent centered table
and then a
get_table_rows
helper function thats like thisIt would be awesome if I could have a simple styled centered table from an object
sl.Table(my_data)