I am working with a table that contains various rows and fields. In one row, I have two fields set to display:none;
. When I drag this row, it creates a lateral padding effect in the <tbody>
and the <thead>
, rather than shrinking the table itself.
In the following JsFiddle, you can see that the first row does not function correctly, while the second row, which only has one field with display:none;
, works as expected.
If you have any questions, feel free to ask.
Example of Errors: https://i.sstatic.net/Sutpz.png
Table Behavior During Dragging:
https://i.sstatic.net/mJhHv.png
Initially, I attempted to solve the issue by counting the number of <td>
elements with the class .hidden-td
(the class with display: none;
) and identifying the element with the class .placeholder-style
(the class associated with the <tr>
generated during dragging). However, this approach did not work as expected.
To determine the number of fields with the class .hidden-td
, I used the following line of code:
var numcells = $('.hidden-td').length;
Issue:
In one row, I have 9 elements, while in another, there are only 8. Within my function start()
, I hide a single column in the placeholder. Consequently, when I drag the first row, one column remains without the .hidden-td
class, resulting in an empty space at the end of the columns.
How can I resolve this problem?