Jump to content

Photo

Sortable Tables on Personal Websites


  • Please log in to reply
4 replies to this topic

#1 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 17 November 2017 - 09:19 AM

I have a question. Something I really want is to have a personal website with sortable tables.

 

I used to have a sortable table with clickable headers, like the second table found on this page: https://kryogenix.or...wser/sorttable/ , but to get that working I had to use this code:

<script src="sorttable.js"></script> 

 which basically linked my page with the sortable table to another page on my site with the actual javascript file. The problem is that, after a few months the site I was using (webs.com) stopped supporting any coding languages other than basic html, which sucked ass because I was using using xhtml, css, and javascript in addition to html throughout my site, so everything broke.

 

I tried using a Google personal website, but they didn't support linking to a javascript file at all.

 

This site has very nice sortable (and searchable) tables: https://www.bu.edu/t...rchable-tables/ , but as far as I can tell that code is only available to their customers(?)

 

Do you know how I can simply get a free personal site that will host sortable tables with no problems?


Edited by Cukeman, 17 November 2017 - 05:28 PM.


#2 Saffith

Saffith

    IPv7 user

  • ZC Developers

Posted 17 November 2017 - 02:36 PM

Couldn't you just put the script directly in the HTML file? JavaScript runs client-side, so it shouldn't need any particular support from the host.

#3 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 17 November 2017 - 02:59 PM

I have huge doubts that'd work on the two host sites listed above, but I can give it a try.

 

Would I just paste the code directly between the scripts tags like this:

<script>CODE</script> 

Somehow I think that's not what you're suggesting.



#4 Saffith

Saffith

    IPv7 user

  • ZC Developers

Posted 17 November 2017 - 03:40 PM

Pretty close. There's a tag attribute:
<script type="text/javascript">
code here
</script>
In XHTML, it would be:
<script type="text/javascript">
//<![CDATA[
code here
//]]>
</script>


#5 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 17 November 2017 - 05:18 PM

This is what I've got:

<!DOCTYPE html>
<html>
<body>

<script type="text/javascript">
CODE HERE
</script>

<table class="sortable">
  <tr>
    <th>Name</th><th>Salary</th><th>Extension</th><th>Start date</th>
    <th>Start date (American)</th>
  </tr>
  <tr><td>Bloggs, Fred</td><td>$12000.00</td>
      <td>1353</td><td>18/08/2003</td><td>08/18/2003</td></tr>
  <tr><td>Turvey, Kevin</td><td>$191200.00</td>
      <td>2342</td><td>02/05/1979</td><td>05/02/1979</td></tr>
  <tr><td>Mbogo, Arnold</td><td>$32010.12</td>
      <td>2755</td><td>09/08/1998</td><td>08/09/1998</td></tr>
  <tr><td>Shakespeare, Bill</td><td>$122000.00</td>
      <td>3211</td><td>12/11/1961</td><td>11/12/1961</td></tr>
  <tr><td>Shakespeare, Hamnet</td><td>$9000</td>
      <td>9005</td><td>01/01/2002</td><td>01/01/2002</td></tr>
  <tr><td>Fitz, Marvin</td><td>$3300</td>
      <td>5554</td><td>22/05/1995</td><td>05/22/1995</td></tr>
</table>

</body>
</html>
 

("code here" content: https://kryogenix.or...le/sorttable.js)

 

No luck on webs.com, still need to try Google




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users