ng-table icon indicating copy to clipboard operation
ng-table copied to clipboard

How can i set width of columns?

Open pankajdugar opened this issue 12 years ago • 4 comments

I am unable to add width to columns. Can someone help me with this?

pankajdugar avatar Nov 13 '14 10:11 pankajdugar

Add attribute 'header-class' with desired value and use CSS to set width On Nov 13, 2014 12:33 PM, "pankajdugar" [email protected] wrote:

I am unable to add width to columns. Can someone help me with this?

— Reply to this email directly or view it on GitHub https://github.com/esvit/ng-table/issues/456.

maxaon avatar Nov 13 '14 10:11 maxaon

I applied the 'header-class' as you suggested and it reflected the css only in header as the attribute states. The changes do not show in the td below the headers. Also, my data is being loaded through ajax, so before the data is fetched, the header cell width looks like what i set (50%) but as soon as the data is populated, it somehow overrides the width i set. Any idea?

pankajdugar avatar Nov 13 '14 11:11 pankajdugar

Share the css as well as the html here.

On Thu, Nov 13, 2014 at 4:40 PM, pankajdugar [email protected] wrote:

I applied the 'header-class' as you suggested and it reflected the css only in header as the attribute states. The changes do not show in the td below the headers. Also, my data is being loaded through ajax, so before the data is fetched, the header cell width looks like what i set (50%) but as soon as the data is populated, it somehow overrides the width i set. Any idea?

— Reply to this email directly or view it on GitHub https://github.com/esvit/ng-table/issues/456#issuecomment-62875692.

RohithAcharya avatar Nov 13 '14 12:11 RohithAcharya

If you are using bootstrap applying col-md / col-sm etc.. will solve your problem. IF you are not using dynamic columns. In that case you need to implement a service/function which calculates the values.

If I can recall correctly you can use sub whole numbers as well like 0.5 etc.

noherczeg avatar Feb 10 '15 00:02 noherczeg