Filter on TH

3 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: April 3, 2013   (RSS)

By gregThomas - April 3, 2013

Hi Djulia,

You're close, the filter you need to use to change the styling on the table header rows is listHeader_thAttributes, I've also made a couple of extra changes to your code:

addFilter('listHeader_thAttributes', '_alignThOnList', null, 3);

function _alignThOnList($thStyle, $tableName, $fieldname) {
  
  if ($fieldname = 'num_value') { $thStyle .= ' style="text-align:right;"'; }
  return $thStyle;
}

I've added the correct filter, and also changed the the code so that the style gets appended to the current string as opposed to overwriting it, as CMS Builder might have added its own attributes to the tag. 

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By Djulia - April 3, 2013

Hi Greg,

It is perfect! :)

Thanks!

Djulia