Wrox Programmer Forums
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 8th, 2010, 10:57 AM
Authorized User
 
Join Date: May 2004
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default Swap HTML Columns

Hi ALL,


I need to Swap columns in the Table Based ont he Drop down list selected in the Order
For example below i s the HTML Table by default column Heading in the Order One , Two , three , four.

If I select Two in the drop down list the Table should display Two in the order (below column value) , One (below column value) ,Three(below column value) ,Four(below column value)

If I select Three in the drop down list the Table should display in the order Three (below column value) , One (below column value) ,two(with below column value) ,Four (below column value)

If I select four in the drop down list the table should display in the order four (below column value) , One (below column value) ,two (with below column value) ,three(below column value)

Please Help me out with some solution As I am new to Javascript?????

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
< META NAME="Generator" CONTENT="EditPlus">
< META NAME="Author" CONTENT="">
< META NAME="Keywords" CONTENT="">
< META NAME="Description" CONTENT="">
<form name="frmOne" id="frmOne">

<select name="selOne" id="selOne" onchange="testcall();">
<option value="0">Please select</option>
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
<option value="4">Four</option>
</select>

</br></br></br>
<table id="tblOne" border="1" cellspacing="3" cellpadding="3">

<tr><td>&nbsp;</td><td id="Name11">One</td><td id="Name12">Two</td><td id="Name13">Three</td><td id="Name14">Four</td></tr>
<tr><td>&nbsp;</td><td id="Name21">10</td><td id="Name22">40</td><td id="Name23">70</td><td id="Name24">100</td></tr>
<tr><td>&nbsp;</td><td id="Name31">20</td><td id="Name32">50</td><td id="Name33">80</td><td id="Name34">110</td></tr>
<tr><td>&nbsp;</td><td id="Name41">30</td><td id="Name42">60</td><td id="Name43">90</td><td id="Name44">120</td></tr>

</table>

</form>

</BODY>
</HTML>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Swap the element Nagaraj XSLT 8 April 28th, 2009 04:30 AM
Swap Images Mike707 Dreamweaver (all versions) 3 December 18th, 2006 01:05 PM
Problem to Swap two number in C# furqanms C# 1 June 5th, 2006 05:12 PM
How to swap many html files to same <i frame> bekim Javascript How-To 9 January 21st, 2005 11:13 PM
ASP/SQL data in HTML table columns spinout Classic ASP Basics 2 January 9th, 2005 07:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.