1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Help sorting an HTML table

Discussion in 'Web Design & Development' started by joeymilan89, Jan 28, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. joeymilan89

    joeymilan89 Thread Starter

    Joined:
    Feb 20, 2006
    Messages:
    47
    Hi, I've been trying to sort an HTML table using every script i've come upon over the internet. Nothing works. The latest has been sorttable.js, but I get an error from it. I am using the newest Firefox and IE and they both show the same problem. Here is my coding, please help.

    Source: http://www.freewebs.com/clancrit

    Code:
    <html>
    
    <head>
    
    <title>Clan CRiT</title>
    
    <script src="sorttable.js"></script>
    
    </head>
    
    <body bgcolor="333333" text="white" link="white" alink="white" vlink="white">
    
    <table border="0" bordercolor="222111"  cellspacing="1" cellpadding="1" width="100%" bgcolor="black">
    
    <tr>
    
    <td><font face="verdana" size="4" color="FF9900"><center>Clan CRiT Player Statistics</center></font></td>
    
    </tr>
    
    </table>
    
    </br>
    
    <table class="sortable" id="table0" border="0" width="100%" cellpadding="1" cellspacing="1" bgcolor="black">
    
    <tr>
    <th bgcolor="123252" align="center"><font face="verdana" size="2" color="yellow">Clan Rank</font></th>
    <th bgcolor="123252" align="center"><font face="verdana" size="2" color="yellow">Player</font></th>
    <th bgcolor="123252" align="center"><font face="verdana" size="2" color="yellow">Games Played</font></th>
    <th bgcolor="123252" align="center"><font face="verdana" size="2" color="yellow">Wins</font></th>
    <th bgcolor="123252" align="center"><font face="verdana" size="2" color="yellow">Losses</font></th>
    <th bgcolor="123252" align="center"><font face="verdana" size="2" color="yellow">Hero Kills</font></th>
    <th bgcolor="123252" align="center"><font face="verdana" size="2" color="yellow">Unit Kills</font></th>
    <th bgcolor="123252" align="center"><font face="verdana" size="2" color="yellow">Razes</font></th>
    </tr>
    
    <tr onmouseover="this.style.backgroundColor = '#123241';" onmouseout="this.style.backgroundColor = '#000000';">
    <td><font face="verdana" size="2" color="FF9900"><center>Chieftain</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>lost.my.skill.</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>3</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>2</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>1</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>10</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>127</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>10</center></font></td>
    
    </tr>
    
    <tr>
    <tr onmouseover="this.style.backgroundColor = '#123241';" onmouseout="this.style.backgroundColor = '#000000';">
    <td><font face="verdana" size="2" color="FF9900"><center>Shaman</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>L0.0K</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>3</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>2</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>1</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>9</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>188</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>1</center></font></td>
    
    </tr>
    
    <tr>
    <tr onmouseover="this.style.backgroundColor = '#123241';" onmouseout="this.style.backgroundColor = '#000000';">
    <td><font face="verdana" size="2" color="FF9900"><center>Grunt</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>sHaReUnItSpLz</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>1</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>1</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>0</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>2</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>52</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>1</center></font></td>
    
    </tr>
    
    <tr>
    <tr onmouseover="this.style.backgroundColor = '#123241';" onmouseout="this.style.backgroundColor = '#000000';">
    <td><font face="verdana" size="2" color="FF9900"><center>Grunt</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>fArmA_</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>1</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>1</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>0</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>3</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>15</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>0</center></font></td>
    
    </tr>
    
    <tr>
    <tr onmouseover="this.style.backgroundColor = '#123241';" onmouseout="this.style.backgroundColor = '#000000';">
    <td><font face="verdana" size="2" color="FF9900"><center>Grunt</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>LincoLn</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>1</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>0</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>1</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>0</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>49</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>0</center></font></td>
    
    </tr>
    
    <tr>
    <tr onmouseover="this.style.backgroundColor = '#123241';" onmouseout="this.style.backgroundColor = '#000000';">
    <td><font face="verdana" size="2" color="FF9900"><center>Grunt</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>LimitBreaks</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>1</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>1</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>0</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>0</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>84</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>5</center></font></td>
    
    </tr>
    
    <tr>
    <tr onmouseover="this.style.backgroundColor = '#123241';" onmouseout="this.style.backgroundColor = '#000000';">
    <td><font face="verdana" size="2" color="FF9900"><center>Grunt</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>Gawdly.</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>2</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>2</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>0</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>12</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>174</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>5</center></font></td>
    
    </tr>
    
    <tr>
    <tr onmouseover="this.style.backgroundColor = '#123241';" onmouseout="this.style.backgroundColor = '#000000';">
    <td><font face="verdana" size="2" color="FF9900"><center>Grunt</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>PhillyWilly</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>1</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>0</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>1</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>0</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>42</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>2</center></font></td>
    
    </tr>
    
    <tr>
    <tr onmouseover="this.style.backgroundColor = '#123241';" onmouseout="this.style.backgroundColor = '#000000';">
    <td><font face="verdana" size="2" color="FF9900"><center>Grunt</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>Ulz</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>1</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>1</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>0</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>2</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>52</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>4</center></font></td>
    
    </tr>
    
    </tr>
    
    <tr>
    <tr onmouseover="this.style.backgroundColor = '#123241';" onmouseout="this.style.backgroundColor = '#000000';">
    <td><font face="verdana" size="2" color="FF9900"><center>Grunt</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>Jiyun-</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>1</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>0</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>1</center></font></td>
    
    <td><font face="verdana" size="2" color="FF9900"><center>1</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>23</center></font></td>
    <td><font face="verdana" size="2" color="FF9900"><center>6</center></font></td>
    </tr>
    
    </table>
    
    <table>
    
    <tr>
    <td colspan="7" align="center"><em><font face="verdana" size="1">Coded by lost.my.skill. - 2007(c)</font></em></td>
    </tr>
    
    </table>
    
     
  2. MMJ

    MMJ Guest

    Joined:
    Oct 15, 2006
    Messages:
    3,625
    What is wrong? :confused:
     
  3. matt-h

    matt-h

    Joined:
    Apr 30, 2006
    Messages:
    333
    It will sort once only. You have to reload the page to do it again. Thats what wrong. Dont know how to fix it though.
     
  4. joeymilan89

    joeymilan89 Thread Starter

    Joined:
    Feb 20, 2006
    Messages:
    47
    Does anyone? Because it gives an error at the bottom and it worked on the sites I got the sort table code from.
     
  5. sarei

    sarei

    Joined:
    Dec 13, 2006
    Messages:
    38
    Where did you get the code from?
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/539074

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice