Problem/Motivation
I just found that if I use table in Views, text-align is always set to left.
Steps to reproduce
Align in Views -> Format -> Table -> Settings is not work at all. I can override it per your suggestion in this issue -> https://www.drupal.org/project/d8w3css/issues/3258081 but with many columns each column has its own alignment.
Proposed resolution
I then, tried to remove "text-align" setting below in w3.css :
.w3-table td,
.w3-table th,
.w3-table-all td,
.w3-table-all th {
padding: 8px 8px;
display: table-cell;
/* text-align: left; */
vertical-align: top;
}Then, align is work as it should. I can set it to align to whatever I want in Views Setting UI.
I think this line can be removed since the default for text-align is Left anyway (For Left-to-Right language). It will also better for Right-to-Left language since it will default to Right.
Remaining tasks
User interface changes
API changes
Data model changes
Thanks for create this great theme.
Issue fork d8w3css-3328823
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3328823-text-align-in-table
changes, plain diff MR !2
Comments
Comment #2
flashwebcenterHello,
I removed the align left in the dev version since the default is left.
Best wishes,
Alaa
Comment #3
abx commentedThanks flashwebcenter,
I just found that you remove text-align in file css/components/w3css-tables.css but not in css/w3-css/w3.css
Can you please do that too?
Thank you,
Comment #5
abx commentedNot sure I did it correctly. First time trying to create "merge requests".
Comment #6
flashwebcenterHello,
As a general rule, I don't modify the original library. I did reset the align left class and updated views classes. It should be working now with left to right or right to left languages.
Best wishes,
Alaa
Comment #7
abx commentedYes, it works now.
Thanks flashwebcenter
Comment #10
flashwebcenter