->addColumn('enroll', function ($row) { $iconClass = $row->enroll === 1 ? 'far fa-check-circle text-success' : 'fa fa-exclamation-circle text-dark'; $btn = '<a href="javascript:void(0)" class="enroll-toggle" data-id="' . $row->id . '" data-status="' . $row->enroll . '">'; $btn .= '<i class="' . $iconClass . '"></i>'; $btn .= '</a>'; return $btn; })
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter