Laravel-datatables: How to render HTML in column

Created on 12 May 2017  Â·  6Comments  Â·  Source: yajra/laravel-datatables

How to render HTML in column ?? only action column render as HTML

question

Most helpful comment

All 6 comments

Thankuu :)

On Sat, May 13, 2017 at 1:55 AM, Darryl Meganoski notifications@github.com
wrote:

https://yajrabox.com/docs/laravel-datatables/7.0/raw-columns

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/yajra/laravel-datatables/issues/1143#issuecomment-301177396,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACNiWQA3xn4I_20KFLK-_CeppdZteSz_ks5r5MAlgaJpZM4NZAeE
.

Hello @yajra i have this challenge. How do i render HTML code in datatables
screen shot 2018-10-06 at 3 42 01 pm

->rawColumns([
                    'Hits'
                ])

Just add this you're good to go

Just need to add ->escapeColumns([]) like as below ``

return Datatables::of($posts)
    ->editColumn('address1', function ($user) {
         return $user->address1 .'<br>'.$user->city_name .'<br>'.$user->state_name .'<br>'.$user->pin_code;
    })
    ->escapeColumns([])
    ->make(true);

```

Just need to add ->escapeColumns([]) like as below ``

return Datatables::of($posts)
  ->editColumn('address1', function ($user) {
       return $user->address1 .'<br>'.$user->city_name .'<br>'.$user->state_name .'<br>'.$user->pin_code;
  })
  ->escapeColumns([])
  ->make(true);

This work perfectly for me, thx

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Yahav picture Yahav  Â·  16Comments

MahdiPishguy picture MahdiPishguy  Â·  17Comments

ezani92 picture ezani92  Â·  33Comments

ruchisheth picture ruchisheth  Â·  16Comments

baig772 picture baig772  Â·  14Comments