jadrake75 / ng-scrolling-table

MIT License
8 stars 2 forks source link

Cleaner Table Definition? #14

Closed Xanir closed 10 years ago

Xanir commented 10 years ago

Instead of a normal HTML table definition what about something like this:

<div scrolling-table>
    <!-- Column One -->
    <div>
        <div table-header></div>
        <div table-data></div>
    </div>

    <!-- Column Two -->
    <div>
        <div table-header></div>
        <div table-data></div>
    </div>
</div>

IMHO that format is much clearer and easier to read and it better marries the data columns to the headers

jadrake75 commented 10 years ago

Perhaps it could be explored as an alternative in the future, but I would rather keep a table as a table. There are some really nice benefits we get from a HTML table impl. and I don't think we should rule it out quite yet

Xanir commented 10 years ago

I meant that this would just be how the directive is defined in the mark up, and would be converted to an actual table, as it exists now, by the directive.

Xanir commented 10 years ago

If we keep the current table definition can we assume an ng-repeat for the tr of the tbody? It is causing some issues with being able to define a row as an array of TD templates. Without this array we would need to do manual DOM manipulation to be able to reorder columns.

jadrake75 commented 10 years ago

I believe once we transition to a custom ng-repeater on a scroller we'll be able to handle this better.

Xanir commented 10 years ago

I'm going to call this moot. Personally I dislike normal table definitions. However there is no reason a different directive couldn't take something like the code above and transform it in a compile function to match the standard table definition required by ng-scrolling-table.