title: How to set padding to columns in table layout dynamically
body: <p>I am trying to create a table layout with buttons dynamically. I am able to get the table layout with buttons. bt i need padding between buttons. How i can get programatically.</p>
  
  <p>I tried following code bt </p>
  
  <pre><code>private void showCowsTblField()
  {
  
      for (int row = 0; row &lt; numberOfRowsInField-1; row++)
      {
          TableRow tableRow = new TableRow(this);  
          tableRow.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT ));
          for (int column = 0; column &lt; numberOfColumnsInField -1; column++)
          {
              blocks[row][column].setLayoutParams(new LayoutParams(  
                      LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT)); 
              blocks[row][column].setPadding(blockPadding, blockPadding, blockPadding, blockPadding);
  
              tableRow.addView(blocks[row][column]);
              tableRow.setPadding(blockPadding, blockPadding, blockPadding, blockPadding);
          }
          tblCows.addView(tableRow,new TableLayout.LayoutParams(  
                  LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));  
      }
  }
  </code></pre>
  
  <p>Please let me know.... Thanks.</p>