title: Drag and dropping columns PHP, JS, how can that be done?
body: <p>I was able to get the rows to be drag and dropped within the table, but I am having difficulty with the columns. My bellow javascript doesn't seem to work. Any help will be greatly appreciated</p>
  
  <pre><code>&lt;?php
  
  
  if(!$link = mysql_connect("localhost", "root", "")) {
       echo "Cannot connect to db server";
  }
  elseif(!mysql_select_db("Disney")) {
       echo "Cannot select database";
  }
  else {
       if(!$rs = mysql_query("SELECT * FROM DisneyCharacters")) {
            echo "Cannot parse query";
       }
       elseif(mysql_num_rows($rs) == 0) {
            echo "No records found";
       }
       else {
  //      Name, Movie, year, ShoeSize, FavoriteColor, FavoriteFood, PhoneNumber, CharacterType, FavoriteDrink, Address, FavortieTvShow, School, Age, HouseSqFoot, RelationShip, Rating, CarModel, CarYear, Boyfriend,
  // NumberFriends, CriminalHistory, HappyEnding, FavoriteLocation, AppleDevice, WorkLocation, Weight, RepublicanDemocratic, DressColor, Shampoo, NumberKids) 
  
            echo "&lt;table  width=\"400\" height=\"1\" id=\"sortedtable\" class=\"bordered\" cellspacing=\"0\"&gt;\n";
            echo "&lt;thead&gt;\n&lt;tr&gt;";
            echo "&lt;th&gt;Name  &lt;/th&gt;";
            echo "&lt;th&gt;Movie  &lt;/th&gt;";
            echo "&lt;th&gt;Year  &lt;/th&gt;";
            echo "&lt;th&gt;Shoe Size &lt;/th&gt;";
            echo "&lt;th&gt;Favorite Color &lt;/th&gt;";
            echo "&lt;th&gt;Favorite Food &lt;/th&gt;";
            echo "&lt;th&gt;Phone Number &lt;/th&gt;";
            echo "&lt;th&gt;Character Type &lt;/th&gt;";
            echo "&lt;th&gt;Favorite Drink &lt;/th&gt;";
            echo "&lt;th&gt;Address &lt;/th&gt;";
            echo "&lt;th&gt;Favorite TvShow &lt;/th&gt;";
            echo "&lt;th&gt;School &lt;/th&gt;";
            echo "&lt;th&gt;Age &lt;/th&gt;";
            echo "&lt;th&gt;HouseSqFoot &lt;/th&gt;";
            echo "&lt;th&gt;Relationship &lt;/th&gt;";
            echo "&lt;th&gt;Rating &lt;/th&gt;";
            echo "&lt;th&gt;Car Model &lt;/th&gt;";
            echo "&lt;th&gt;Car Year &lt;/th&gt;";
            echo "&lt;th&gt;Boyfriend &lt;/th&gt;";
            echo "&lt;th&gt;Number Friends &lt;/th&gt;";
            echo "&lt;th&gt;Criminal History &lt;/th&gt;";
            echo "&lt;th&gt;Happy Ending &lt;/th&gt;";
            echo "&lt;th&gt;Favorite Location &lt;/th&gt;";
            echo "&lt;th&gt;Apple Device &lt;/th&gt;";
            echo "&lt;th&gt;Work Location &lt;/th&gt;";
            echo "&lt;th&gt;Weight&lt;/th&gt;";
            echo "&lt;th&gt;Republican Democratic &lt;/th&gt;";
            echo "&lt;th&gt;Dress Color &lt;/th&gt;";
            echo "&lt;th&gt;Shampoo &lt;/th&gt;";
            echo "&lt;th&gt;Number Kids &lt;/th&gt;";
  echo "&lt;/tr&gt;\n&lt;/thead&gt;\n";
  
  
            echo " &lt;tbody&gt;";
            while($row = mysql_fetch_array($rs)) {
  
  
                 echo "&lt;tr&gt;
                      &lt;td&gt;$row[Name]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[Movie]&amp;nbsp&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[Year]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[ShoeSize]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[FavoriteColor]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[FavoriteFood]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[PhoneNumber]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[CharacterType]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[FavoriteDrink]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[Address]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[FavoriteTvShow]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[School]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[Age]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[HouseSqFoot]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[RelationShip]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[Rating]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[CarModel]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[CarYear]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[Boyfriend]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[NumberFriends]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[CriminalHistory]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[HappyEnding]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[FavoriteLocation]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[AppleDevice]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[WorkLocation]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[Weight]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[RepublicanDemocratic]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[DressColor]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[Shampoo]&amp;nbsp&lt;/td&gt;
                      &lt;td&gt;$row[NumberKids]&amp;nbsp&lt;/td&gt;
                  &lt;/tr&gt;\n";
  
  
  
            }
             echo " &lt;/tbody&gt;";
            echo "&lt;/table&gt;&lt;br /&gt;\n";
       }
  
  }
  ?&gt;
  </code></pre>
  
  <p>///JavaScript</p>
  
  <pre><code>// Drag and drop rows
  $(document).ready(function () {
      $("#sortedtable").tablesorter({
          sortList: [
              [0, 0],
              [2, 1]
          ],
          widgets: ['zebra']
      });
      $("tbody").sortable();
      $("tbody").disableSelection();
  });
  
  
  //Drag and drop columns 
  $(document).ready(function () {
      $("#sortedtable").tablesorter({
          sortList: [
              [0, 0],
              [2, 1]
          ],
          widgets: ['zebra']
      });
      $("thead").sortable();
      $("thead").disableSelection();
  });
  </code></pre>