Expose table in Drupal View
A problem in your code is that you are missing

return $data;


You also need to define the base for the table:

$data['attendance_percentage']['table']['base'] = array(
  'title' =&gt; t('Attendance'),
);


Should be enough.

Also remember you need to clear cache.