The best solution I've found to accomplish this is to create a "partial" layout representing the table row, with a style defined:
<?xml version="1.0" encoding="utf-8"?>
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/tr_withborder" />
Then inflate it in your code, to use dynamically:
TableRow tr = (TableRow) getLayoutInflater().inflate(R.layout.partial_table_row, null);
While not ideal, it does work for me
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…