Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 7th, 2010, 01:06 AM
Authorized User
Points: 134, Level: 2
Points: 134, Level: 2 Points: 134, Level: 2 Points: 134, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2010
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sorting and fixed Table Headers in HTML Table..Urgent help!!

Hi


Can anyone tell me how to add Sorting and fixed Table Headers to an HTML Table?
Reply With Quote
  #2 (permalink)  
Old February 7th, 2010, 04:04 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Would help to define what you mean. What is a "Fixed Table Header" in your mind?

And do you mean you want the capability to sort the rows of a <table> based on the user clicking on one of the column headers? If so, *how* will you do the sorting? Will you use JavaScript in the browser or will you sort on the backend, using ASP/PHP/JSP/whatever?
Reply With Quote
  #3 (permalink)  
Old February 7th, 2010, 05:46 PM
Friend of Wrox
Points: 1,749, Level: 16
Points: 1,749, Level: 16 Points: 1,749, Level: 16 Points: 1,749, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: San Diego, CA, USA.
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

You can't sort an *HTML* table. It simply doesn't support that function. The easiest and fastest way to add sorting to a table is by using an ASP.NET GridView.

As Old Pedant says, you can also perform sorting client side using Javascript but that will mean that your application won't work for a significant cross section of your visitors. However, if you don't mind losing a small but significant percentage of your visitors, and *this sounds like the deal breaker for you* IF you have the time to custom program a javascript sorting application, it would offload the work client side and improve application scalability.
__________________
-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
Reply With Quote
  #4 (permalink)  
Old February 8th, 2010, 05:17 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Sorry, chroniclemaster, I have to disagree with you. You can sort an HTML table, using JavaScript. Mind you, I don't think its the best idea, but it can be done.
Reply With Quote
  #5 (permalink)  
Old February 8th, 2010, 06:38 PM
Friend of Wrox
Points: 1,749, Level: 16
Points: 1,749, Level: 16 Points: 1,749, Level: 16 Points: 1,749, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: San Diego, CA, USA.
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

Quote:
Originally Posted by Old Pedant View Post
Sorry, chroniclemaster, I have to disagree with you. You can sort an HTML table, using JavaScript. Mind you, I don't think its the best idea, but it can be done.
Agreed. :) I'm sorry, I thought I had said as much, but I simply meant that *HTML* cannot provide sorting. I was trying to direct him to the ASP.NET or Javascript forums; my fault for merely implying rather than explicitly saying you can get better assistance at one of the other topics.
__________________
-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
Reply With Quote
  #6 (permalink)  
Old September 17th, 2010, 05:59 AM
Registered User
 
Join Date: Sep 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to bhagwan
Thumbs up table help

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">

<head>
<title>Classic Movies Times</title>
</head>

<body>
<table border="1" width="500">
<caption>Classic Movie Day</caption>
<tr>
<th></th>
<th width="200">5 pm</th>
<th width="200">7 pm</th>
<th width="200">9 pm</th>
<th width="200">11 pm</th>
</tr>
<tr>
<th>Screen one</th>
<td>Star Wars</td>
<td>Empire Strikes Back</td>
<td>Return of the Jedi</td>
<td>The Exorcist</td>
</tr>
<tr>
<th>Screen two</th>
<td colspan="2">Dances with Wolves</td>
<td colspan="2">Gone With the Wind</td>
</tr>
<tr>
<th>Screen three</th>
<td colspan="2">2001: A Space Odyssey</td>
<td>The Conversation</td>
<td>5 Easy Pieces</td>
</tr>
</table>

</body>
</html>

Don't forgot to thanx me
bhagwanramsain@rediffmail.com
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
very urgent:cals table to indesign table using xsl franklinclinton XSLT 1 December 16th, 2009 03:48 PM
Fixed table columns darkhalf HTML Code Clinic 1 August 27th, 2008 02:05 AM
Transform html table to add ids/headers using xsl kapy_kal XSLT 2 February 21st, 2007 10:12 AM
Fixed size table amc Dreamweaver (all versions) 4 August 29th, 2004 07:03 AM
XML to HTML Table with Sorting and Distinct VictorMk XSLT 4 April 23rd, 2004 06:29 PM



All times are GMT -4. The time now is 05:36 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.