Some code (not a plugin yet) for left-justifying tables

Some code (not a plugin yet) for left-justifying tables

draperddraperd Posts: 10Questions: 4Answers: 0

I've created a modification of the datatables column-width computation to allow a designated column to fill to take up remaining space --- which is nice for creating a left-justified table without squashing any word-breakable columns to their narrowest width.

It isn't in plugin form, but I thought I'd share it here. I'd like feedback on whether it should be made in to a plugin or not, or what features it would need to be completed. For example right now the designated column is indicated by a class on a header cell, but ideally it would be a column option.

https://gist.github.com/denised/a7bc5d8cb578f782bad5a4be75b88cb8

Replies

  • allanallan Posts: 50,034Questions: 1Answers: 7,401 Site admin

    Awesome! Thanks for sharing this with us. I'm certain that others will be able to make use of this as the column sizing currently implemented in DataTables, while it works for the majority of cases, doesn't always suit everyone.

    Along with the scrolling code, the width calculation stuff is probably the ickiest part of DataTables!

    Allan

  • draperddraperd Posts: 10Questions: 4Answers: 0

    It certainly is icky, but conceptually so simple --- I wouldn't have even tried this if I didn't have your code to start from :)

Sign In or Register to comment.