Jump to content

Lisa67000

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by Lisa67000

  1. Hello,

     

    I use this code to move(sortable) the rows of my table. I have a problem, he apply the js code to all the table!!! Even without tbody! Do you know why?  thank you a lot!!!

     

    		<div style="overflow-x: auto;">
    			<table id="table_id" style="overflow-x: auto;">
    				<thead>
    					<tr class="ui-state-default">
    						<th>1</th>
    						<th>2</th>
    						<th>3</th>
    						<th>4</th>
    						<th>5</th>
    						<th>6</th>
    						<th>7</th>
    						<th>8</th>
    						<th>Position</th>
    					</tr>
    				</thead>
     
    				<tbody>
       					<tr>
    						<td contenteditable='true'>1</td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'>1</td>
    					</tr>
    					   					<tr>
    						<td contenteditable='true'>2</td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'>2</td>
    					</tr>
    					   					<tr>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'>3</td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'></td>
    						<td contenteditable='true'>3</td>
    					</tr>
    				</tbody>
    			</table>
    $("table tbody").sortable({
    	update : function(event, ui) {
    		$(this).children().each(function(index) {
    			$(this).find('td').last().html(index + 1)
    		});
    	}
    });
  2. Hi everybody!

     

    I'm there. I love w3schools, it's so great and full of knowledge.

     

    Actually, I'm working on a private project in HTML/CSS/JS/SQL.

    Hope to share with you!!

    xxx

×
×
  • Create New...