how to set margin between TableRow android
<p>I found a lot of solutions about TableRow margin, but when I tried the rows dont margin at all. </p>

<p>This is my code:</p>

<pre><code>        TableLayout table = (TableLayout)findViewById(R.id.myTableLayout);

        for (int i = 0; i &lt; 3; i++) {
            TableRow tr = new TableRow(this);
            LayoutParams layoutParams = new LayoutParams(
                    LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
            int leftMargin=110;
            int topMargin=100;
            int rightMargin=100;
            int bottomMargin=100;
            layoutParams.setMargins(leftMargin, topMargin, rightMargin, bottomMargin);
            tr.setLayoutParams(layoutParams);
            tr.setBackgroundResource(R.drawable.shelf_bar);

            table.addView(tr, new TableLayout.LayoutParams(
                    LayoutParams.FILL_PARENT,
                    LayoutParams.FILL_PARENT));
        }
</code></pre>

<p>This is my expected result :</p>

<p><img src="http://i.stack.imgur.com/eLrMd.jpg" alt="enter image description here"></p>

<p>Please anyone point my mistake out. Thanks</p>
