[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 324
  • Last Modified:

javascript, jquery, table

http://www.kryogenix.org/code/browser/sorttable/

I have used above js for my html table. It works fine until I add one extra thead
like the following. After I added 'thead', the sorting feature is no longer available.
any experts can help?

Thanks

<table>
<thead>
<tr><td>....</td></tr>
</thead>
<thead>
<tr><td>....</td></tr>
<thead>
<tbody>
<tr><td>...</td></tr>
</tbody>
</table>
0
Webboy2008
Asked:
Webboy2008
  • 3
1 Solution
 
soupBoyCommented:
I am not familiar with that script, however it may be a typo in your 'pseudo' code you pasted....but I see you are not closing your <thead> tags....

 <table>
<thead>
<tr><td>....</td></tr>
</thead>
<thead>
<tr><td>....</td></tr>
<thead> <!-- was this meant to be closed? ie: </thead> -->
<tbody>
<tr><td>...</td></tr>
</tbody>
</table>

Open in new window

0
 
Webboy2008Author Commented:
why don't you just download the file and add the codes...yes it is missing the </thead>
you can add it and try and see it works or not.
0
 
soupBoyCommented:
Downloading the script wouldn't mean a thing if your markup is bad.

With your example post, your markup was bad.  

Please post your code, otherwise we have nothing to go off of.
0
 
soupBoyCommented:
It looks like you should only have one <thead> element.
0
 
lwadwellCommented:
'sorttable' will not work if there are two or more rows inside the <thead>,
'sorttable' does work if there are two <thead> definitions ... only the first <thead> will be 'clickable' to perform sorts ... the second <thead> is ignored.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now