Code example for TableRow

Methods: addViewlayout, setPadding

0
	 
	public void title_display() 
	{ 
		 
		Log.d("in function title display","iiiiiiiiiiii");
		final TableRow tr1 = new TableRow(this); 
		tr1.layout(0, 0, 0, 0); 
		 
		 
		   
		final TextView name = new TextView(this);
		name.setText(" Name"); 
		name.setTextColor(Color.WHITE);
		name.setBackgroundColor(Color.parseColor("#220A29"));
		name.setPadding(10, 0, 0, 0);  
		tr1.setPadding(0, 1, 0, 1);
		tr1.addView(name);
		 
		final TextView email = new TextView(this);
		email.setText("Email ID"); 
		email.setTextColor(Color.WHITE);
		email.setBackgroundColor(Color.parseColor("#220A29"));
		email.setPadding(10, 0, 0, 0);  
		tr1.setPadding(0, 1, 0, 1);
		tr1.addView(email);
		tb.addView(tr1, new TableLayout.LayoutParams(
		          LayoutParams.WRAP_CONTENT,
		         LayoutParams.WRAP_CONTENT));
	}