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

Consider removing style="width:auto" from column filter inputs

Open dan-cooke opened this issue 8 years ago • 12 comments

Using the style attribute is kind of bad practice, and it interferes with bootstrap etc.

dan-cooke avatar Oct 13 '16 13:10 dan-cooke

its causing the columns (in my case 9) to bleed off the page rather than bootstrap to reactively resize

glangston83 avatar Nov 02 '16 18:11 glangston83

Can someone do this? It is really interfering with all of bootstrap design...

KevKo1990 avatar Dec 24 '16 22:12 KevKo1990

Could you please remove [style="width: auto;"] from the bundle?

luissalcedo avatar Jan 19 '17 09:01 luissalcedo

It's not a proper way but it helps me to solve this problem (Little bad hack). Add below to your css file: .ng-table>tbody>tr:first-child>td>input { width: 100% !important; }

Where "ng-table" is class of table (Add it to config.className:['ng-table'] in your component file).

Napster2210 avatar Jan 19 '17 10:01 Napster2210

Napster2210, thank you very much for the answer!

luissalcedo avatar Feb 21 '17 20:02 luissalcedo

@Napster2210 how could u override inline css with class selector? I tried your method and failed

eago avatar Apr 14 '17 09:04 eago

@eago Can you please post your ng2-table configuration object here?

Napster2210 avatar Apr 14 '17 09:04 Napster2210

@Napster2210 I've known the trick !important to override inline css now.... But still it doesn't work. CSS: .ng2-table>tbody>tr>td>input { width: 100% !important; }

TS: public config: any = { paging: true, //sorting: {columns: this.columns}, filtering: {filterString: ''}, className: ['table-striped', 'table-bordered', "ng2-table"] };

well i can see "ng2-table" is configured in the source view of Chrome

eago avatar Apr 14 '17 11:04 eago

@eago Got your point just rename your class other than "ng2-table". I suggest you to use "ng-table" as class only.

Napster2210 avatar Apr 14 '17 11:04 Napster2210

@Napster2210 thanks for your suggestion, i've tried, still not working. finallly, i move the css override sentence to styles.css in the racine of angular project, not the one of my component, and it works. I thinks it's some trick about CSS encapsulation of Angular2

eago avatar Apr 14 '17 14:04 eago

@Napster2210 thanks, it worked!

+1 for the issue!

bobvann avatar Dec 27 '17 08:12 bobvann

Hi, Can you suggest me to increase size of columns in ng2 table? As i've 15 columns and i've added scroll bar too for horizontal display. Is there any way to customize the ng 2 table header? help will be appreciated...

prasanna-sasne avatar Feb 12 '18 12:02 prasanna-sasne