detailview widget : html option have disappeared


there are many things I like in version 2 but I have so much trouble just to get numbers rightaligned in a Detailview widget ! Am I blind ? Can anyone help me ?

Thanks !

In fact there is no HTML options in the ListView :

But I think you can edit the template ($template-detail) like this :

echo DetailView::widget([

    'model' => $model,

    'template' => function ($attribute, $index, $widget) {

      if($attribute == 'number')

        return "<tr><th>{label}</th><td class=\"text-right\">{value}</td></tr>";


        return "<tr><th>{label}</th><td>{value}</td></tr>";


    'attributes' => [