It's a function, you can have it in a separate shared file, and call it whenever you need.
Do you need to be more dynamic? You can create Angular Attribute Directive, and add it to the tables that you need, you want it to be even better? Use Renderedr2 instead of jQuery, you don't need jQuery here you already have a great way provided by Angular
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…