Change text of only parent table

Im trying to merge some cells, but my first step is to pull the values from each cell of the first coloum of a table, so Ive written the following to try and get my workings sorted which should just  put "h" into each cell of the first coloum:-

$(document).ready(function () {
    $('#tbl1 tr td:nth-child(1)').each(function (){

Open in new window

Seems to work well, but (and I know its bad practice) I've got nested tables, so the child tables also get "h" put in. Ive put it in jsfiddle to try and show what I mean at

Is there anyway I can limit the code to only look at the table, and not child tables?

Thank you
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris StanyonWebDevCommented:
Change your selector so you only grab the DIRECT children of your main table:

$('#tbl1 > tbody > tr > td:nth-child(1)').each(function (){

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.