How to center TabbedContent #5376
-
Hi, i am trying to center TabbedContent to have the Tabs at the center of the screen, is there a way to do this? |
Beta Was this translation helpful? Give feedback.
Answered by
TomJGooding
Dec 11, 2024
Replies: 2 comments 1 reply
-
We found the following entries 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 |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think adding something like this in your CSS should work: from textual.app import App, ComposeResult
from textual.widgets import Static, TabbedContent
class ExampleApp(App):
CSS = """
TabbedContent {
& > ContentTabs {
#tabs-list {
align-horizontal: center;
}
}
}
"""
def compose(self) -> ComposeResult:
with TabbedContent("Foo", "Bar", "Baz"):
yield Static("Foo")
yield Static("Bar")
yield Static("Baz")
if __name__ == "__main__":
app = ExampleApp()
app.run() |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
leonardig08
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think adding something like this in your CSS should work: