I am using jQuery UI sortable to make my table grid sortable. The code seems to work fine but because I am not adding width to td
s, when I drag the tr
it shrinks the content.
For example; if my table row is 500px when I start dragging, it becomes 300px. I assume that's happening because no width is defined in the grid. That's because I am using two classes for the td
s (fix
and liquid
).
The fix
class makes the td
equal to the content width and liquid
makes the td
width 100%. It's my approach for grid table without having to assign width to td
s.
Any idea how to make sortable work with my approach?
Keith' solution is fine but produced a little havoc in Firefox which did not add up the colspans but cued them. (The old js string type pain in the knee)
replacing this line:
with:
Fixes the problem. (As js is forced to treat the variables as numbers instead of strings)