Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking (Typing support + code fixes) #1

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ website-build/
## Unit test / coverage reports
.coverage
.tox
Pipfile
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,14 @@ corresponds to the `pipe` format without alignment colons:
│ bacon │ 0 │
╘════════╧═══════╛

`fancy_dottedline` is the same as the `simple_grid` format.

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="fancy_dottedline"))
⋅⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯
⋮ spam ⋮ 41.9999 ⋮
⋮ eggs ⋮ 451 ⋮
⋅⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

`presto` is like tables formatted by Presto cli:

```pycon
Expand Down Expand Up @@ -940,6 +948,30 @@ the lines being wrapped would probably be significantly longer than this.
+------------+---------+
```

Text is preferably wrapped on whitespaces and right after the hyphens in hyphenated words.

break_long_words (default: True) If true, then words longer than width will be broken in order to ensure that no lines are longer than width.
If it is false, long words will not be broken, and some lines may be longer than width.
(Long words will be put on a line by themselves, in order to minimize the amount by which width is exceeded.)

break_on_hyphens (default: True) If true, wrapping will occur preferably on whitespaces and right after hyphens in compound words, as it is customary in English.
If false, only whitespaces will be considered as potentially good places for line breaks.

```pycon
>>> print(tabulate([["John Smith", "Middle-Manager"]], headers=["Name", "Title"], tablefmt="grid", maxcolwidths=[None, 5], break_long_words=False))
+------------+---------+
| Name | Title |
+============+=========+
| John Smith | Middle- |
| | Manager |
+------------+---------+
>>> print(tabulate([["John Smith", "Middle-Manager"]], headers=["Name", "Title"], tablefmt="grid", maxcolwidths=[None, 5], break_long_words=False, break_on_hyphens=False))
+------------+----------------+
| Name | Title |
+============+================+
| John Smith | Middle-Manager |
+------------+----------------+
```
### Adding Separating lines
One might want to add one or more separating lines to highlight different sections in a table.

Expand Down
Loading