How to enable on custom shortcodes

You are using esc_attr in your table_data function. This will encode the html in your variable in such a way that it is no longer recognized as html. So the browser will display “<br>” rather than insert a line break.