How to left align column using ViewDataTableFactory


#1

Hi,

I’m using pretty much ViewDataTableFactory for displaying data in a widget. Since 2.15 (?) all columns, except the first one, are aligned to the right, independent if it is a string or a numeric column.

How can I change the alignment?

And second question: How can I change the change the width of the first column. It is ways to wide.

Thanks
Joachim


(Tassoman) #2

Maybe you can try to modify your layout by creating a theme plugin, then try to modify its CSS classes and activate it.

Theming documentation is available at this link: Themes: Develop - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3


#3

Thank you for the tip, but I think it a problem by design.

Piwik formats the first column with
<span class=“label” …

and all other columns of the table with
<span class=“value”

Therefore I think I can’t fix it with another theme.

The problem is caused by the design that since 2.15 (?). Someone has decided to support only one text column. Not very clever in my opinion.

You can see that in the css:
table.dataTable tr td.column:not(.label)
text-align:right;


(Tassoman) #4

Writing your custom Theme Plugin you’re able to write your custom CSS rules that’s are injected after Morpheus loading (the starting theme).

Then you could set there !important rules for columns. I had also issues with very large columns and I did it (before 2.15.x).