DateTable- Unable to set width of a column with Grouping

UI Components for Angular
Post Reply
ammarkhan91
Posts: 35
Joined: 22 Apr 2016, 23:22

26 Apr 2016, 20:18

When using datatable with grouping, I can't be able to set the width of a column.

Let's take the below example

http://www.primefaces.org/primeng/#/datatablegroup

If I want to change the width for any of the column, how would I do that? I added inline style on p-column but that doesn't seems to be working. Please suggest

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

27 Apr 2016, 09:24

For example to increase brand column width;

Code: Select all

this.headerRows = [
            {
                columns: [
                    {header: 'Brand', rowspan: 3, style:'width:300px'},
                    {header: 'Sale Rate', colspan: 4}
                ]
            },
            {
                columns: [
                    {header: 'Brand', colspan: 2},
                    {header: 'Sale Rate', colspan: 2}
                ]
            },
            {
                columns: [
                    {header: 'Last Year'},
                    {header: 'This Year'},
                    {header: 'Last Year'},
                    {header: 'This Year'}
                ]
            }
        ];

ammarkhan91
Posts: 35
Joined: 22 Apr 2016, 23:22

27 Apr 2016, 13:41

Yes, that works. But what if we want to set the width of the column those are in group. Like if we need to give more width to the Last Year column, how that could be done?

Also, can you please mention what properties we can pass to the column definition array? where to find it's detail?

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

29 Apr 2016, 16:57

See the column component property table please;

http://www.primefaces.org/primeng/#/datatable

ammarkhan91
Posts: 35
Joined: 22 Apr 2016, 23:22

10 May 2016, 21:16

Please let me know how to set style when setting in code like above with Angular RC 1 inline style breaking change in primeng?

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 25 guests