To make textview wrap in table row which is dynamically created you need to use layout_weights. Add a layout_weight of 2 to table row and 1 for text views.
TableRow.LayoutParams lp = new TableRow.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, 2f);
TableRow tr = new TableRow(tl.getContext());
tr.setLayoutParams(lp);
For text view
tv.setLayoutParams(new TableRow.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, 1f));
If your table columns get disturbed, then make your text view width to 0 pixels to get equal column width
tv.setWidth(0);