返回相同的行格式 [英] Getting back same row format

查看:191
本文介绍了返回相同的行格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面有这段代码,允许我将值从绿色水果表移动到随机水果表,反之亦然,但问题是我将所有从建议的水果表绿色水果表的所有值作为单个列返回,我希望它遵循原始格式,即连续3个单元格.有没有简单的方法可以做到这一点?任何帮助将不胜感激.

我尝试过的事情:

这是我的JSFiddle [

I have this code below that allows me to move the value from Green Fruits Table to Random Fruits Table and vice versa but the problem is that after I move all the value from Suggested Fruits Table to Green Fruit Table all the value comes back as a single column and i want it to follow the original format which is 3 cells in a row. Is there any easy way to accomplish this? Any help would be greatly appreciated.

What I have tried:

Here is my JSFiddle[^]

推荐答案

每次将水果从建议"移到绿色"时,您都在创建一个新的该水果的TR/TD-因此它将显示为新行(TR)...
您必须选择:
1.找到绿色"的最后一行,检查那里是否有空间(少于3个TD)...如果有空间,则在最后一行(TR)内将新水果作为新TD添加,否则今天就要做(新的TR/TD)
2.使用flex-gird和DIV而不是TABLE/TR/TD
Every time you move a fruit from ''Suggested'' to ''Green'' you are creating a new TR/TD for that fruit - so it will be displayed as new line (TR)...
You have to options:
1. Find the last row of ''Green'' and check if there is room there (less then 3 TDs)... If there is room add the new fruit as new TD inside the last row (TR), otherwise do as you do today (new TR/TD)
2. Use flex-gird and DIV not TABLE/TR/TD


这篇关于返回相同的行格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆