ng2-table
ng2-table copied to clipboard
Consider removing style="width:auto" from column filter inputs
Using the style attribute is kind of bad practice, and it interferes with bootstrap etc.
its causing the columns (in my case 9) to bleed off the page rather than bootstrap to reactively resize
Can someone do this? It is really interfering with all of bootstrap design...
Could you please remove [style="width: auto;"] from the bundle?
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, thank you very much for the answer!
@Napster2210 how could u override inline css with class selector? I tried your method and failed
@eago Can you please post your ng2-table configuration object here?
@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 Got your point just rename your class other than "ng2-table". I suggest you to use "ng-table" as class only.
@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
@Napster2210 thanks, it worked!
+1 for the issue!
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...