Jquery find Char length and set width based on it

Jquery find Char length and set width based on it

Hey, I'm having a problem getting this to work:

$('#itemListLeading table tr :nth-child(2)').each(function(){
  $length = $(this).children().text().length;
     console.log($length);
}):

I want to find each of the 2nd table data's character length and eventually assign a width based on the largest one, but I seem to be getting errors with the first line and I don't know why. I have tested it without the each function and I'm able to return the full length of all the table datas but I want to be able to return 1 at a time and set a variable based on that. Can anyone help?