change table cells position - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:appendTo

Description

change table cells position

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> 
  <script type="text/javascript">
    $(function(){//from   w w  w  . j av a  2 s  . co  m
$('#mytable tr td:eq(0)').appendTo('#mytable tr');
    });

      </script> 
 </head> 
 <body> 
  <table id="mytable"> 
   <tbody> 
    <tr> 
     <td>1</td> 
     <td>2</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials