detailview widget : html option have disappeared

hello,

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 (http://www.yiiframework.com/doc-2.0/yii-widgets-detailview.html#$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>";

      else

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

    },

    'attributes' => [

        'number',

        ...

    ],

]);