将table中选中的数据移动到右边;
点击一行中的任意一个位置,使其选中:
注:attr()和prop()都是jquery的方法;
.attr() : 获取匹配的元素集合中的第一个元素的属性的值 或 设置每一个匹配元素的一个或多个属性。 •.attr( attributeName ) •.attr( attributeName )
•.attr( attributeName, value ) •.attr( attributeName, value )
•.attr( attributes )
•.attr( attributeName, function(index, attr) )
.prop() : 获取匹配的元素集中第一个元素的属性(property)值或设置每一个匹配元素的一个或多个属性。 •.prop( propertyName ) •.prop( propertyName )
•.prop( propertyName, value ) •.prop( propertyName, value )
•.prop( properties )
•.prop( propertyName, function(index, oldPropertyValue) )
是参数有区别,attr()传入的是attributeName,而prop()传入的是propertyName,
给前面复选框添加选中事件,然后对选中的进行向右边table移动的操作:
将两个table放在两个div中,会存在一根问题,就是td的宽度会不一致;
可以对他们分别设置宽度;
或者,通过js,获取到body中每一个的宽度,然后给thead每一个td加上这个宽度;