cloudflarearchive / backgrid

Finally, an easily stylable semantic HTML data grid widget with a Javascript API that doesn't suck.
http://backgridjs.com
MIT License
2.01k stars 325 forks source link

Responsive table: Render the table as divs rather then table, tr, td etc. elements #543

Closed theinterned closed 9 years ago

theinterned commented 9 years ago

Hi,

I would like to customize Backgrid to render as a series of divs with classes that apply display: [table | table-row | table-cell ...]; so that I can make the table responsive (and display in a "card" style at narrower screen sizes).

Currently I'm thinking of sub-classing all the necessary Views to achieve this, but I'm wondering if anyone can comment on if this is feasible or if there is a better way to achieve this.

Thanks

bruno-c commented 9 years ago

I don't see any particular reason why it wouldn't be feasible, overwriting tagName on all the the different constructors, but it hasn't been tried to my knowledge. It may end up being simpler to write your own "mobile table" view that uses compatible abstractions -- columns, rows, cells, etc.