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

feat(table): add support for line alignment in the table widget #392

Merged
merged 2 commits into from
Aug 13, 2023
Merged

feat(table): add support for line alignment in the table widget #392

merged 2 commits into from
Aug 13, 2023

Conversation

jkcdarunday
Copy link
Contributor

Since Cell objects already internally contain instances of Line and Line already has alignment info, we can use this to position a line of text inside a table cell.

This PR makes the table render function follow the text line alignment and resolves #257

@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

Merging #392 (a143db7) into main (37fa6ab) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #392      +/-   ##
==========================================
+ Coverage   85.02%   85.09%   +0.06%     
==========================================
  Files          40       40              
  Lines        8683     8707      +24     
==========================================
+ Hits         7383     7409      +26     
+ Misses       1300     1298       -2     
Files Changed Coverage Δ
src/widgets/table.rs 93.01% <100.00%> (+1.05%) ⬆️

@joshka
Copy link
Member

joshka commented Aug 13, 2023

Nice! Welcome to ratatui and thanks for the PR - looks like there were a few +1s on that issue.

@joshka joshka added this pull request to the merge queue Aug 13, 2023
Merged via the queue into ratatui:main with commit 7748720 Aug 13, 2023
@jkcdarunday jkcdarunday deleted the feature/table-text-alignment branch August 13, 2023 09:24
@joshka joshka added this to the v0.23.0 milestone Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow alignment of table columns or cells
4 participants