开发者

Aligning the label fields symfony

I'm using symfony 1.4 doctrine. Is it possible to align the labels using symfony? I have here a format of a auto generated form and I get this format(assume this is a form and "============" is a text box because I cant upload pics.).

               Name of Employee:                     ================
                   Position:                         ================
                Name of Group:                       ================
           Reservation Date: (yyyy/mm/dd)            ================
              Start time schedule:                   ================
                Endtime schedule:                    ================
              Number of employee(s):                 ================

What you see above the labels are all centered. Now I want to know if its possible to display like this format.

               Name of Employee:                     ================
               Position:                             ================
               Name of Group:                        ================
               R开发者_如何学编程eservation Date: (yyyy/mm/dd)        ================
               Start time schedule:                  ================
               Endtime schedule:                     ================
               Number of employee(s):                ================

I tried to used the css like this format label{text-align:left;}. I tried that format but it didn't work. By the way i"m using a flat html format through symfony. I just want to know if it's possible to align those labels on a flat html format. Thanks who can answer =)


Create specific CSS class in your CSS file, such as

.myLabel{
  text-align: left;
}

then in the configure() function of your

/lib/form/doctrine/myModelForm.class.php

put this

$this->sfWidgetFormSchema['my_model']->setAttribute('class', 'myLabel');

finally, if this is not working, check what CSS properties is your label element having and inheriting (with a code inspector like to one provided by chrome and safari for instance)


Seems to be a CSS Problem, as the label elements inherit a text-align:center from either a parent element or from <html> itself. Adding CSS text-align:left to <label> should fix it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜