Skip to content

[FEAT] Align text in a DataTable #3638

Closed as not planned
Closed as not planned

Description

@TomJGooding

It might be nice to have a convenient method to align text in a DataTable, for example to right-align numerical values, or center everything in a table.

I know that cells can contain Rich Text objects, but I just wonder if the alignment could be handled by the DataTable instead. Perhaps the alignment could be defined by column (similar to the tables in Rich)?

Activity

  1. changed the title [-][FEAT] Align text in a `DataTable` cell[/-] [+][FEAT] Align text in a `DataTable`[/+] on Nov 3, 2023
  2. github-actions commented on Nov 3, 2023

    @github-actions

    We found the following entry in the FAQ which you may find helpful:

    Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

    This is an automated reply, generated by FAQtory

  3. boxed commented on Oct 26, 2024

    @boxed

    Being able to set an id or a class on a column to apply styling rules would be nice.

  4. TomJGooding commented on Oct 30, 2024

    @TomJGooding
    ContributorAuthor

    Textual CSS only works with widgets, so I don't think this could work with Table columns. I was thinking something more like add_column(justify="right").

  5. github-actions commented on May 31, 2026

    @github-actions

    I hope I solved your issue!

    Consider sponsoring my work to continue to maintain and develop Textual.

    • Will McGugan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions