Hi,
Can anybody help me out??
I have created a sortable table using Drupal's code. Now I want to make the header name and value in row center aligned. Not able to recognize how doing that.
posting sample code :
$header = array(
array('data' => t(' ID# '), 'field' => 'cust.customer_id'), //
array('data' => t('First Name'), 'field' => 'cust.res_name'), //
array('data' => t('Last Name'), 'field' => 'cust.res_lname'), // these header names (ID # , First Name...etc) should be center aligned
array('data' => t('Email'), 'field' => 'cust.mail_id'), //
array('data' => t('Phone'), 'field' => 'cust.customer_phone'),//
);
$result = db_select('customer_details', 'cust')
->extend('TableSort')
->extend('PagerDefault')
->limit(20)
->fields('cust',array('customer_id', 'res_lname', 'res_mname', 'res_name', 'mail_id', 'con_code1', 'con_code2', 'customer_phone')
->orderByHeader($header)
->execute();
$rows = array();
$row[] = ''.$r->customer_id.''; //
$row[] = ''.$r->res_name.''; //
$row[] = ''.$r->res_lname.''; //these values should be center aligned
$row[] = ''.$r->mail_id.''; //