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

Add ability to remove cell padding #3435

Closed
rmurray2 opened this issue Sep 30, 2023 · 8 comments · Fixed by #3443
Closed

Add ability to remove cell padding #3435

rmurray2 opened this issue Sep 30, 2023 · 8 comments · Fixed by #3443
Assignees
Labels
enhancement New feature or request

Comments

@rmurray2
Copy link

I haven't been able to modify the style of a DataTable so that there is zero space between the columns. This in contrast to the rows, which are stacked with zero space between the cells.

I've tried setting margin, grid-gutter and padding to zero in the TCSS file, with no success:

DataTable {
	grid-gutter: 0;
	padding: 0;
	margin: 0;
} 
@github-actions
Copy link

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

@TomJGooding
Copy link
Contributor

TomJGooding commented Oct 1, 2023

I assume you mean the cell padding that's baked in #2503 (comment).

Textual CSS works at the widget level, but datatable cells aren't widgets internally. Your CSS above is targetting the margin/padding of the table widget itself, not the cells.

@willmcgugan
Copy link
Collaborator

@rmurray2 There's no way to remove the cell padding at the moment. Without cell padding the cells would be right next to each other, and it would be difficult to read.

Perhaps you could explain why you want this? We might be able to offer alternative suggestions.

@rmurray2
Copy link
Author

rmurray2 commented Oct 1, 2023

@willmcgugan thanks for your reply.

I'd ultimately like to generate a heatmap, like the image below, in which the backgrounds correspond to an intensity value for that row/column combination

heatmap

@willmcgugan willmcgugan changed the title Ability remove space between columns of DataTable Add ability to remote cell padding Oct 1, 2023
@willmcgugan
Copy link
Collaborator

That's a novel use for the datatable! I doubt it will be difficult for use to add an option to remove cell padding. We will look in to it for the next version.

@rmurray2
Copy link
Author

rmurray2 commented Oct 1, 2023

Great, thanks, just one suggestion: The column header row will become difficult to read if the padding is removed, so I would suggest, if it's possible, tilting the right side of the labels at about a 45 or more degree angle. Or any arbitrary, user-defined angle. That way they won't run into each other.

@willmcgugan
Copy link
Collaborator

I may not have followed what you are suggesting there, but its impossible to rotate text in the terminal I'm afraid.

@rodrigogiraoserrao rodrigogiraoserrao changed the title Add ability to remote cell padding Add ability to remove cell padding Oct 2, 2023
@rodrigogiraoserrao rodrigogiraoserrao self-assigned this Oct 2, 2023
@rodrigogiraoserrao rodrigogiraoserrao added the enhancement New feature or request label Oct 2, 2023
rodrigogiraoserrao added a commit that referenced this issue Oct 2, 2023
@github-actions
Copy link

github-actions bot commented Oct 3, 2023

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants