title: Adding space between columns of a TableLayout
body: <p>I have a TableLayout where I add dynamically TableRows. In each TableRow, I add a Button.</p>
  
  <p>I just would like to add some space between my columns (which are my buttons) but I can't figure out how...
  I've tried to change all the possible margins but it doesn't work :(
  So maybe I made a mistake in my code where I inflate them from XML files:</p>
  
  <pre><code>private void createButtons(final CategoryBean parentCategory) {
      final List&lt;CategoryBean&gt; categoryList = parentCategory.getCategoryList();
      title.setText(parentCategory.getTitle());
      // TODO à revoir
      int i = 0;
      TableRow tr = null;
      Set&lt;TableRow&gt; trList = new LinkedHashSet&lt;TableRow&gt;();
      for (final CategoryBean category : categoryList) {
  
          TextView button = (TextView) inflater.inflate(R.layout.button_table_row_category, null);
          button.setText(category.getTitle());
          if (i % 2 == 0) {
              tr = (TableRow) inflater.inflate(R.layout.table_row_category, null);
              tr.addView(button);
          } else {
              tr.addView(button);
          }
  
          trList.add(tr);
  
          button.setOnClickListener(new OnClickListener() {
              @Override
              public void onClick(View v) {
                  CategoryBean firstChild = category.getCategoryList() != null &amp;&amp; !category.getCategoryList().isEmpty() ? category
                          .getCategoryList().get(0) : null;
                  if (firstChild != null &amp;&amp; firstChild instanceof QuestionsBean) {
                      Intent intent = new Intent(CategoryActivity.this, QuestionsActivity.class);
                      intent.putExtra(MainActivity.CATEGORY, category);
                      startActivityForResult(intent, VisiteActivity.QUESTION_LIST_RETURN_CODE);
                  } else {
                      Intent intent = new Intent(CategoryActivity.this, CategoryActivity.class);
                      intent.putExtra(MainActivity.CATEGORY, category);
                      startActivityForResult(intent, VisiteActivity.CATEGORY_RETURN_CODE);
                  }
              }
          });
          i++;
      }
      for (TableRow tableRow : trList) {
          categoryLaout.addView(tableRow);
      }
  }
  </code></pre>
  
  <p>My button_table_row_category.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/buttonTableRowCategory"
      style="@style/ButtonsTableRowCategory"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center"
      android:text="@string/validate" /&gt;
  </code></pre>
  
  <p>My table_row_category.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;TableRow xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/tableRowCategory"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_margin="100dp"
      android:gravity="center"
      android:padding="5dp" &gt;
  
  &lt;/TableRow&gt;
  </code></pre>
  
  <p>Thank you for your help.</p>