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

Command icon 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:

Comments

abx created an issue. See original summary.

flashwebcenter’s picture

Status: Active » Fixed

Hello,

I removed the align left in the dev version since the default is left.

Best wishes,
Alaa

abx’s picture

Status: Fixed » Active

Thanks 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,

abx’s picture

Not sure I did it correctly. First time trying to create "merge requests".

flashwebcenter’s picture

Assigned: Unassigned » flashwebcenter
Status: Active » Fixed

Hello,

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

abx’s picture

Yes, it works now.

Thanks flashwebcenter

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

flashwebcenter’s picture