widgetti / widgetti/solara

[Feature Request] New Table component

Open
#63 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.2k
Forks
202
Avg merge
4h 36m
Merged PRs (30d)
3

Description

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

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

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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue proposes a new sl.Table component, accepting a pandas dataframe or list of dictionaries and rendering a centered styled table. No files, tests, or entry points are named, so first locate the existing Solara component API and rendering tests. Done should include a defined input API and coverage for the requested table output and styling.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.