Skip to content

Commit bbfe0e0

Browse files
committed
changed defaults of Table.grid
1 parent 38fd323 commit bbfe0e0

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [1.3.0] Unreleased
8+
## [1.3.1] - Unreleased
9+
10+
### Changed
11+
12+
- Changed defaults of Table.grid
13+
14+
## [1.3.0] - 2020-05-31
915

1016
### Added
1117

rich/__main__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ def __rich_measure__(self, console: "Console", max_width: int) -> Measurement:
3333

3434
def make_test_card() -> Table:
3535
"""Get a renderable that demonstrates a number of features."""
36-
table = Table.grid()
36+
table = Table.grid(padding=1, pad_edge=True)
3737
table.title = "Rich features"
38-
table.expand = False
39-
table.padding = (1, 1, 0, 0)
4038
table.add_column("Feature", no_wrap=True, justify="right", style="bold red")
4139
table.add_column("Demonstration")
4240

@@ -173,5 +171,4 @@ def iter_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:
173171
console.print(test_card)
174172
taken = int((process_time() - start) * 1000.0)
175173
print(console.file.getvalue()) # type: ignore
176-
print()
177174
print(f"rendered in {taken}ms")

rich/table.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,15 @@ def __init__(
168168
def grid(
169169
cls,
170170
padding: PaddingDimensions = 0,
171-
collapse_padding: bool = False,
172-
pad_edge: bool = True,
171+
collapse_padding: bool = True,
172+
pad_edge: bool = False,
173173
) -> "Table":
174174
"""Get a table with no lines, headers, or footer.
175175
176176
Args:
177177
padding (PaddingDimensions, optional): Get padding around cells. Defaults to 0.
178+
collapse_padding (bool, optional): Enable collapsing of padding around cells. Defaults to True.
179+
pad_edge (bool, optional): Enable padding around edges of table. Defaults to False.
178180
179181
Returns:
180182
Table: A table instance.

0 commit comments

Comments
 (0)