To add vertical separator and set the height 1px you can try this
TableLayout tableLayout = (TableLayout) findViewById(R.id.tablelayout);
for (int j = 0; j < 50; j++) {
TableRow tableRow = new TableRow(this);
tableRow.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT));
for (int i = 0; i < 10; i++) {
TextView t = new TextView(this);
t.setText("Dynamic TV");
t.setPadding(10, 10, 10, 10);
t.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
tableRow.addView(t);
// Add vertical separator
View v = new View(this);
v.setLayoutParams(new TableRow.LayoutParams(1, TableRow.LayoutParams.MATCH_PARENT));
v.setBackgroundColor(Color.rgb(50, 50, 50));
tableRow.addView(v);
}
// Added Horizontal line as
View view = new View(this);
view.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, 1));
view.setBackgroundColor(Color.rgb(50, 50, 50));
tableLayout.addView(view);
tableLayout.addView(tableRow, new TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT, 0.1f));