How to create dynamic horizontal table row in android?
<p>My current code is:</p>

<pre><code>for(int i=0;i&lt;jArray.length();i++){
            JSONObject json_data = jArray.getJSONObject(i);
            String b = json_data.getString("examnames");
            JSONObject getexamnamesobject = new JSONObject(b);
            getexamnames=getexamnamesobject.getString("types");
            TableRow tr = new TableRow(this);
            TextView tv1 = new TextView(this);
            createView(tr,tv1,getexamnames);
            t1.addView(tr);
        }
public void createView(TableRow tr, TextView t, String viewdata) {
        t.setText(viewdata);
        //adjust the porperties of the textView
        t.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
        //t.setTextColor(Color.DKGRAY);
        //t.setBackgroundColor(Color.CYAN);
        t.setPadding(20, 0, 0, 0); 
        tr.setPadding(0, 1, 0, 1); 
        //tr.setBackgroundColor(Color.BLACK);
        tr.addView(t); // add TextView to row.
        }
</code></pre>

<p>My output for above code is, I'm getting textviews vertically like this:</p>

<pre><code>English
Maths
Science
</code></pre>

<p>What must be the change in the above coding to get the horizontal output like this:</p>

<pre><code>English Maths Science
</code></pre>

<p>Please help me. This very important for me
Thanks in advance</p>
