Skip to content

Hide a column in the DataTable #5699

Answered by TomJGooding
Salvodif asked this question in Q&A
Discussion options

You must be logged in to vote

Here's a mininal example using the row key:

import uuid

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

BOOKS = [
    {
        "uuid": str(uuid.uuid4()),
        "title": "To Kill a Mockingbird",
        "author": "Harper Lee",
    },
    {
        "uuid": str(uuid.uuid4()),
        "title": "The Great Gatsby",
        "author": "F. Scott Fitzgerald",
    },
    {
        "uuid": str(uuid.uuid4()),
        "title": "Pride and Prejudice",
        "author": "Jane Austen",
    },
]


class ExampleApp(App):
    def compose(self) -> ComposeResult:
        yield DataTable(cursor_type="row")

    def on_mount(self) -> None:
        table = self.query_one(DataT…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@Salvodif
Comment options

@TomJGooding
Comment options

Answer selected by Salvodif
@Salvodif
Comment options

@TomJGooding
Comment options

@Salvodif
Comment options

@TomJGooding
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