If you are creating a variable that is a bunch of table rows (you are using .= to add to the variable?), then once you are out of the loop you will want to preregister the variable for use in a template. If you are rendering the template in the middle of the loop, then you would just use $templater->register right before you render it.