Skip to content
Discussion options

You must be logged in to vote

Did you try the above while also applying the advice FAQtory gave too?

Here's a standalone example of what should work:

from textual.app import App, ComposeResult
from textual.widgets import DataTable, TabbedContent, TabPane

class DataTableInTabbedContentApp(App[None]):

    CSS = """
    TabbedContent ContentSwitcher, DataTable {
        height: 1fr
    }
    """

    def populate(self, table: DataTable) -> DataTable:
        table.add_columns( "Row", *[f"Column {n+1}" for n in range( 10 )])
        for row in range(1_000):
            table.add_row(*[str(row), *[ str(n) for n in range(10)]])
        return table

    def compose(self) -> ComposeResult:
        with TabbedContent():
   …

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@davep
Comment options

@cristianprice
Comment options

@davep
Comment options

Answer selected by cristianprice
@cristianprice
Comment options

@davep
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2957 on July 17, 2023 18:55.