How to set content of column to align right

Hi @johnny and @all,

please help how to set content of column to align right …

I have tried like this but it doesn’t work

$crud->callbackColumn('amount', function ($value) {
    if (!empty($value)) return "<span style=\"text-align:right\">".$value."</span>";
});

Thank you in advance
dodo

Hello @dodo.selusin ,

Since the column is not taking the full width of the table this is only possible by hardcoding the width of the column. For example by adding width: 300px. So in your example it would be something like this:

$crud->callbackColumn('amount', function ($value) {
    if (!empty($value)) return "<span style=\"text-align:right; width: 300px\">".$value."</span>";
});
1 Like

Hi @johnny,

Thank you for your respons, I try your example but still not working, except I add the “display:block” in “style” like this ::

$crud->callbackColumn('credit', function ($value) {
  if (!empty($value)) return "<span style=\"text-align:right;display:block;width:100px;\">".($value < 0 ? number_format($value * -1) : 0)."</span>";
});

but the column become too wide, but it’s ok for now, maybe further there is an update from you

regards,
dodo