Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column width is incorrect when show_row_numbers=True #10570

Open
1 task done
hysts opened this issue Feb 12, 2025 · 1 comment
Open
1 task done

Column width is incorrect when show_row_numbers=True #10570

hysts opened this issue Feb 12, 2025 · 1 comment
Labels
bug Something isn't working 💾 Dataframe

Comments

@hysts
Copy link
Collaborator

hysts commented Feb 12, 2025

Describe the bug

When show_row_numbers=False, the column widths are automatically adjusted as expected, like this:

But, when show_row_numbers=True, the automatic adjustment doesn't work correctly, and the table is rendered like this:

The column width adjustment should ignore the row number column and apply to the actual data columns, but it doesn't seem to be working that way.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr
import pandas as pd

df = pd.DataFrame(
    data=[
        {
            "status": "RUNNING",
            "title": "The quick brown fox jumps over the lazy dog",
            "hardware": "cpu-basic",
        }
    ]
)

with gr.Blocks() as demo:
    gr.Dataframe(value=df, show_row_numbers=True)
demo.launch()

Screenshot

No response

Logs

System Info

gradio==5.16.0

Severity

I can work around it

@hysts hysts added the bug Something isn't working label Feb 12, 2025
@hysts
Copy link
Collaborator Author

hysts commented Feb 12, 2025

This is probably a related issue, so I’m adding it here, but when the table is wide and show_row_numbers=True, the last column disappears.

show_row_numbers=False:

out0.mp4

show_row_numbers=True:

out1.mp4

repro:

import gradio as gr
import pandas as pd

df = pd.DataFrame(
    data=[
        {
            "status": "RUNNING",
            "title": "The quick brown fox jumps over the lazy dog",
            "summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
            "hardware": "cpu-basic",
            "sdk": "gradio",
        }
    ] * 100
)

with gr.Blocks() as demo:
    gr.Dataframe(value=df, show_row_numbers=True)
demo.launch()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 💾 Dataframe
Projects
None yet
Development

No branches or pull requests

2 participants