[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Split table first and rest

Posted on 2013-12-05
1
Medium Priority
?
217 Views
Last Modified: 2013-12-20
Im trying to split a table into first and rest rows, however my code doesnt seem to pull any rows:-
        function modTable($tableID) {
	        var $firstRow = $('#' + $tableID.id + ' tr:first');
	        var $restRows = $('#' + $tableID.id + ' tr').not(':first');
		}
        modTable($('#myTableID'));

Open in new window


Any ideas what Im doing wrong?

Thank you in advance
0
Comment
Question by:tonelm54
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 82

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 39699467
Use :
        function modTable($table) {
	        var $firstRow = $('#' + $table.attr("id") + ' tr:first');
	        var $restRows = $('#' + $table.attr("id") + ' tr').not(':first');
		}
        modTable($('#myTableID'));

Open in new window


Or better :
        function modTable($table) {
	        var $firstRow = $('tr:first', $table);
	        var $restRows = $('tr:gt(0)', $table);
		}
        modTable($('#myTableID'));

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question