{"id":495,"date":"2022-10-10T13:06:28","date_gmt":"2022-10-10T13:06:28","guid":{"rendered":"https:\/\/allabout.cc\/a1\/?page_id=495"},"modified":"2022-10-10T13:06:28","modified_gmt":"2022-10-10T13:06:28","slug":"495-2","status":"publish","type":"page","link":"https:\/\/allabout.cc\/a1\/495-2\/","title":{"rendered":""},"content":{"rendered":"\n<title><\/title>\n<style type=\"text\/css\">table {\n  border-spacing: 0;\n  width: 100%;\n  border: 1px solid #ddd;\n}\n\nth, td {\n  text-align: left;\n  padding: 16px;\n}\n\ntr:nth-child(even) {\n  background-color: #f2f2f2\n}\n<\/style>\n<p>Click the button to sort the table alphabetically, by name:<\/p>\n\n<p><button onclick=\"sortTable()\">Sort<\/button><\/p>\n\n<table id=\"myTable\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<th>Name<\/th>\n\t\t\t<th>Country<\/th>\n\t\t<\/tr>\n\t\t<tr>\n\t\t\t<td>Berglunds snabbkop\n\t\t\t<div class=\"col-sm-2\"><a class=\"pull-right\" href=\"\/users\"><img class=\"img-circle img-responsive\" src=\"http:\/\/www.rlsandbox.com\/img\/profile.jpg\" title=\"profile image\" \/><\/a><\/div>\n\t\t\t<\/td>\n\t\t\t<td>Sweden<\/td>\n\t\t<\/tr>\n\t\t<tr>\n\t\t\t<td>North\/South<\/td>\n\t\t\t<td>UK<\/td>\n\t\t<\/tr>\n\t\t<tr>\n\t\t\t<td>Alfreds Futterkiste\n\t\t\t<div class=\"col-sm-2\"><a class=\"pull-right\" href=\"\/users\"><img class=\"img-circle img-responsive\" src=\"http:\/\/www.rlsandbox.com\/img\/profile.jpg\" title=\"profile image\" \/><\/a><\/div>\n\t\t\t<\/td>\n\t\t\t<td>Germany<\/td>\n\t\t<\/tr>\n\t\t<tr>\n\t\t\t<td>Koniglich Essen\n\t\t\t<div class=\"col-sm-2\"><a class=\"pull-right\" href=\"\/users\"><img class=\"img-circle img-responsive\" src=\"http:\/\/www.rlsandbox.com\/img\/profile.jpg\" title=\"profile image\" \/><\/a><\/div>\n\t\t\t<\/td>\n\t\t\t<td>Germany<\/td>\n\t\t<\/tr>\n\t\t<tr>\n\t\t\t<td>Magazzini Alimentari Riuniti\n\t\t\t<div class=\"col-sm-2\"><a class=\"pull-right\" href=\"\/users\"><img class=\"img-circle img-responsive\" src=\"http:\/\/www.rlsandbox.com\/img\/profile.jpg\" title=\"profile image\" \/><\/a><\/div>\n\t\t\t<\/td>\n\t\t\t<td>Italy<\/td>\n\t\t<\/tr>\n\t\t<tr>\n\t\t\t<td>Paris specialites\n\t\t\t<div class=\"col-sm-2\"><a class=\"pull-right\" href=\"\/users\"><img class=\"img-circle img-responsive\" src=\"http:\/\/www.rlsandbox.com\/img\/profile.jpg\" title=\"profile image\" \/><\/a><\/div>\n\t\t\t<\/td>\n\t\t\t<td>France<\/td>\n\t\t<\/tr>\n\t\t<tr>\n\t\t\t<td>Island Trading\n\t\t\t<div class=\"col-sm-2\"><a class=\"pull-right\" href=\"\/users\"><img class=\"img-circle img-responsive\" src=\"http:\/\/www.rlsandbox.com\/img\/profile.jpg\" title=\"profile image\" \/><\/a><\/div>\n\t\t\t<\/td>\n\t\t\t<td>UK<\/td>\n\t\t<\/tr>\n\t\t<tr>\n\t\t\t<td>Laughing Bacchus Winecellars\n\t\t\t<div class=\"col-sm-2\"><a class=\"pull-right\" href=\"\/users\"><img class=\"img-circle img-responsive\" src=\"http:\/\/www.rlsandbox.com\/img\/profile.jpg\" title=\"profile image\" \/><\/a><\/div>\n\t\t\t<\/td>\n\t\t\t<td>Canada<\/td>\n\t\t<\/tr>\n\t<\/tbody>\n<\/table>\n<script>\nfunction sortTable() {\n  var table, rows, switching, i, x, y, shouldSwitch;\n  table = document.getElementById(\"myTable\");\n  switching = true;\n  \/*Make a loop that will continue until\n  no switching has been done:*\/\n  while (switching) {\n    \/\/start by saying: no switching is done:\n    switching = false;\n    rows = table.rows;\n    \/*Loop through all table rows (except the\n    first, which contains table headers):*\/\n    for (i = 1; i < (rows.length - 1); i++) {\n      \/\/start by saying there should be no switching:\n      shouldSwitch = false;\n      \/*Get the two elements you want to compare,\n      one from current row and one from the next:*\/\n      x = rows[i].getElementsByTagName(\"TD\")[0];\n      y = rows[i + 1].getElementsByTagName(\"TD\")[0];\n      \/\/check if the two rows should switch place:\n      if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) {\n        \/\/if so, mark as a switch and break the loop:\n        shouldSwitch = true;\n        break;\n      }\n    }\n    if (shouldSwitch) {\n      \/*If a switch has been marked, make the switch\n      and mark that a switch has been done:*\/\n      rows[i].parentNode.insertBefore(rows[i + 1], rows[i]);\n      switching = true;\n    }\n  }\n}\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>Click the button to sort the table alphabetically, by name: Sort Name Country Berglunds snabbkop Sweden North\/South UK Alfreds Futterkiste Germany Koniglich Essen Germany Magazzini Alimentari Riuniti Italy Paris specialites France Island Trading UK Laughing Bacchus Winecellars Canada<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"hide_page_title":"","_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":""},"_links":{"self":[{"href":"https:\/\/allabout.cc\/a1\/wp-json\/wp\/v2\/pages\/495"}],"collection":[{"href":"https:\/\/allabout.cc\/a1\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/allabout.cc\/a1\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/allabout.cc\/a1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/allabout.cc\/a1\/wp-json\/wp\/v2\/comments?post=495"}],"version-history":[{"count":1,"href":"https:\/\/allabout.cc\/a1\/wp-json\/wp\/v2\/pages\/495\/revisions"}],"predecessor-version":[{"id":496,"href":"https:\/\/allabout.cc\/a1\/wp-json\/wp\/v2\/pages\/495\/revisions\/496"}],"wp:attachment":[{"href":"https:\/\/allabout.cc\/a1\/wp-json\/wp\/v2\/media?parent=495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}