Support dynamic columns
This might already be supported that I just don't know how to do it right.
$scope.users = [
{name: 'teemo', age: 15},
{name: 'volibear', age: 16},
{name: 'lee sin', age: 17},
{name: 'lissandra', age: 18},
{name: 'caitlyn', age: 19}
];
$scope.fields = [
{key: 'name', title: 'Champion Name'},
{key: 'age', title: 'Champion Age'}
];
<table ng-table class="table">
<tr ng-repeat="user in users">
<td data-title="field.title" ng-repeat="field in fields">{{user[field.key]}}</td>
</tr>
</table>
The only thing I'm having problems with is it's not displaying the title :smirk:

+1
Have you tried:
<td data-title="{{field.title}}" ng-repeat="field in fields">{{user[field.key]}}</td>
I don't know if it works but if is an attribute that's how you would bind it to a string.
I have, but because $parse is used on the data-title, it's not able to expose the binding in arrays.
This is the error when trying to bind the attrbibute to a string:
Error: [$parse:syntax] Syntax Error: Token 'segment' is unexpected, expecting [:] at column 3 of the expression [{{segment}}] starting at [segment}}].
please, look this example https://github.com/esvit/ng-table/blob/master/examples/demo20.html
imo, this qualifies as a hack. My one major issue is that this does not meet the HTML table spec. I should be able to add dynamic columns in the <thead>.
I agree seems backwards to me rather than passing the title from the same place which is what will happen with most API's
+1. I have the same problem, and it also applies to the pagination since colspan is not set correctly. It doesn't feel right to have to copy the default header & footer templates into my own code just because I've got a dynamic column list coming back from the server. I've already bound the dynamic "columns" variable to the ng-table directive.
+1. I have checke the example https://github.com/esvit/ng-table/blob/master/examples/demo20.html . The td in tfoot is keep use colspan="0". That will broke the table's layout.