Programmatically set margin for TableRow
<p>I have <code>TableRows</code> created dynamically in the code and I want to set margins for these <code>TableRows</code>.</p>

<p>My <code>TableRows</code> created as follow:</p>

<pre><code>// Create a TableRow and give it an ID
        TableRow tr = new TableRow(this);       
        tr.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));  
        Button btnManageGroupsSubscriptions = new Button(this);
        btnManageGroupsSubscriptions.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, 40));

        tr.addView(btnManageGroupsSubscriptions);
        contactsManagementTable.addView(tr);
</code></pre>

<p>How do I dynamically set the margins for these?</p>
