diff --git a/.changeset/short-carrots-beg.md b/.changeset/short-carrots-beg.md new file mode 100644 index 0000000000000..2eaedec59de61 --- /dev/null +++ b/.changeset/short-carrots-beg.md @@ -0,0 +1,6 @@ +--- +"@gradio/dataframe": patch +"gradio": patch +--- + +fix:Fix margin above `gr.Dataframe` when no header is provided diff --git a/gradio/templates.py b/gradio/templates.py index da3f74f165b7e..ec76e966f8c80 100644 --- a/gradio/templates.py +++ b/gradio/templates.py @@ -686,7 +686,7 @@ def __init__( show_row_numbers: bool = False, show_search: Literal["none", "search", "filter"] = "none", pinned_columns: int | None = None, - show_fullscreen_button: bool = True, + show_fullscreen_button: bool = False, max_chars: int | None = None, show_copy_button: bool = False, ): @@ -765,7 +765,7 @@ def __init__( show_row_numbers: bool = False, show_search: Literal["none", "search", "filter"] = "none", pinned_columns: int | None = None, - show_fullscreen_button: bool = True, + show_fullscreen_button: bool = False, max_chars: int | None = None, show_copy_button: bool = False, ): diff --git a/js/dataframe/Dataframe.stories.svelte b/js/dataframe/Dataframe.stories.svelte index f5d407c002c5f..9c7116d136692 100644 --- a/js/dataframe/Dataframe.stories.svelte +++ b/js/dataframe/Dataframe.stories.svelte @@ -152,6 +152,21 @@ }} /> + + set_cell_widths()} />
-
- {#if label && label.length !== 0 && show_label} -
-

{label}

-
- {/if} - handle_search(e.detail)} - on_commit_filter={commit_filter} - {current_search_query} - /> -
+ {#if (label && label.length !== 0 && show_label) || show_fullscreen_button || show_copy_button || show_search !== "none"} +
+ {#if label && label.length !== 0 && show_label} +
+

{label}

+
+ {/if} + handle_search(e.detail)} + on_commit_filter={commit_filter} + {current_search_query} + /> +
+ {/if}