title: How to modify (TableLayout margin's embeded in Relativelay out in xml) in code
body: <p>i have main.xml :</p>
  
  <pre><code>     &lt;? xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout  xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:background="@drawable/detailsback"&gt;    
    &gt;
  
  &lt;TextView  
  android:id="@+id/name"
  android:layout_width="wrap_content" 
  android:layout_height="wrap_content" 
  android:layout_marginTop="30px"
  android:layout_marginBottom="10px"
  /&gt;
  
  &lt;EditText  
  android:id="@+id/ed"
  android:layout_width="200px" 
  android:layout_height="200px"
  android:editable="false"
  android:focusable="false"
  android:text="ddddddddddd"
  android:layout_below="@id/name"
  /&gt;
  
  &lt;TableLayout
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_alignParentBottom="true"
  android:id="@+id/tableLayout"
   &gt;
  
  &lt;TableRow&gt;    
  
    &lt;Button  
  android:id="@+id/btn1"
  android:layout_width="50px" 
  android:layout_height="50px" 
  android:layout_marginRight="15px"
  /&gt;
  
      &lt;Button  
  android:id="@+id/btn2"
  android:layout_width="40px" 
  android:layout_height="50px"  
  android:layout_marginRight="15px"
  /&gt;
  
        &lt;Button  
  android:id="@+id/btn3"
  android:layout_width="100px" 
  android:layout_height="20px" 
  android:layout_marginRight="15px"
  /&gt;
  &lt;/TableRow&gt;
  
  &lt;TableRow&gt;    
  
     &lt;Button  
  android:id="@+id/btn4"
  android:layout_width="50px" 
  android:layout_height="50px"  
  android:layout_marginRight="15px"
  android:layout_marginTop="5px"
  /&gt;
  
  &lt;Button  
  android:id="@+id/btn5"
  android:layout_width="30px" 
  android:layout_height="50px"  
  android:layout_marginRight="15px"
  android:layout_marginTop="5px"    
  /&gt;
    &lt;Button  
  android:id="@+id/btn6"
  android:layout_width="100px" 
  android:layout_height="20px"  
  android:layout_marginRight="15px"
  android:layout_marginTop="5px"
  /&gt;
  &lt;/TableRow&gt;
  &lt;/TableLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>in the code i used</p>
  
  <pre><code>  setContentView(R.layout.main);
  </code></pre>
  
  <p>now i  want to modify  TableLayout margin's according to screen resolution , the problem is how to reach to TableLayout via code , i tried this : </p>
  
  <pre><code>TableLayout table=(TableLayout)findViewById(R.id.tableLayout);
      LayoutParams pa=new LayoutParams();
      pa.bottomMargin=20;
      pa.rightMargin=20;
  
      table.setLayoutParams(pa);
  </code></pre>
  
  <p>but it don't work !! </p>