Skip to content

Commit 67d9044

Browse files
committed
better docs
1 parent 4ddeae2 commit 67d9044

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/textual/widgets/_data_table.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@
4646
CellType = TypeVar("CellType")
4747
"""Type used for cells in the DataTable."""
4848

49-
_DEFAULT_CELL_X_PADDING = 1
50-
"""Default padding to use on each side of a column in the data table."""
51-
5249
_EMPTY_TEXT = Text(no_wrap=True, end="")
5350

5451

@@ -381,7 +378,7 @@ class DataTable(ScrollView, Generic[CellType], can_focus=True):
381378
show_cursor = Reactive(True)
382379
cursor_type: Reactive[CursorType] = Reactive[CursorType]("cell")
383380
"""The type of the cursor of the `DataTable`."""
384-
cell_padding = Reactive(_DEFAULT_CELL_X_PADDING)
381+
cell_padding = Reactive(1)
385382
"""Horizontal padding between cells, applied on each side of each cell."""
386383

387384
cursor_coordinate: Reactive[Coordinate] = Reactive(
@@ -658,7 +655,7 @@ def __init__(
658655
cursor_foreground_priority: Literal["renderable", "css"] = "css",
659656
cursor_background_priority: Literal["renderable", "css"] = "renderable",
660657
cursor_type: CursorType = "cell",
661-
cell_padding: int = _DEFAULT_CELL_X_PADDING,
658+
cell_padding: int = 1,
662659
name: str | None = None,
663660
id: str | None = None,
664661
classes: str | None = None,

tests/test_data_table.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from textual.geometry import Offset
1212
from textual.message import Message
1313
from textual.widgets import DataTable
14-
from textual.widgets._data_table import _DEFAULT_CELL_X_PADDING
1514
from textual.widgets.data_table import (
1615
CellDoesNotExist,
1716
CellKey,
@@ -26,6 +25,9 @@
2625
ROWS = [["0/0", "0/1"], ["1/0", "1/1"], ["2/0", "2/1"]]
2726

2827

28+
_DEFAULT_CELL_X_PADDING = 1
29+
30+
2931
class DataTableApp(App):
3032
messages_to_record = {
3133
"CellHighlighted",

0 commit comments

Comments
 (0)