Ngx-datatable: Column alignment

Created on 2 Jan 2017  路  6Comments  路  Source: swimlane/ngx-datatable

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[x ] feature request
[ ] support request => Please do not submit support request here

Current behavior
No property to set text alignment for columns

Expected behavior
A property to determine whether the texk in column should be left, right or center aligned

What is the motivation / use case for changing the behavior?
Presentation of text and numeric data on a grid, eg Price list

Please tell us about your environment:
All

  • Table version: 4.0.0

  • Angular version: 2.2.3

  • Browser: [all ]

  • Language: [all]

Accepting PRs Confirmed Easy Enhancement Low

Most helpful comment

Done in 8.0

All 6 comments

Sounds like a good change. We should add the ability to define cssClass on the column and it be added to the header cell and body cell elements. Can you PR that?

Hello amcdnl,

Thanks for agreeing with my point. Please how do I "...PR that"?

Cheers

I see a first PR has been merged for this functionality, but I think it shouldn't be considered complete:

  • There are no docs about it yet.
  • A property for table is similarly called cssClasses and means something totally different.
  • It has just been implemented for column definition as an object using the columns attribute, but there is not a cssClasses attribute for column elements.
  • With the merged implementation, the class only applies to the cells, not the header. Maybe it would be better to have a headerClasses and a cellClasses properties to discriminate, or just apply the classes to both header and cells, and then in CSS we are able to combine selectors to discriminate between header and cell if necessary.

What do you think, @amcdnl ?

Done in 8.0

thanks handy for addition, but how would you use it now without resorting to deprecaged ::ng-deep ?

Was this page helpful?
1 / 5 - 1 ratings

Related issues

devendraYebhi picture devendraYebhi  路  3Comments

ChanBen picture ChanBen  路  3Comments

JanStock picture JanStock  路  3Comments

DethAriel picture DethAriel  路  3Comments

jguttman94 picture jguttman94  路  3Comments