Try this, because the f-tion each finds an array of elements (even if it is 1), the first parameter is the index of the element in the array, and the second element, you tried to use the index instead of the element. Also wait for jQuery to load.
<script> var k=0; jQuery(function($){ console.log(add()); $('span.str').text(''+k); }); function add(){ $('table tr').each(function (row, e) { var col1 = $(e).children('td:nth-child(1)').text(); var col2 = $(e).children('td:nth-child(2)').text(); if (col1 == 'опоздание более 15мин' && col2 == 'согласовано') { console.log(col1, col2); return ++k; } }); } </script>