user-interfacetagsstruts2struts-html

label and style sheet in struts 2


i have 2 questions: 1)I want to separate "Enter your Name" in <td> and textFiled in other <td>. when i do that these 2 td arent appear in the same vertical alignment. the first one in top and other in bottom i dont know why that happened??? im forced to do like this:

<s:textfield label="Enter your Name" value="" required="true" name="userBean.userName"></s:textfield>

but this option doesnt allow me to give label style sheet and the text field has another style sheet. 2)i build a cascade style sheet but i think it still not taken please if any body give me tutorial or link for tutorial how to use custom cascade style sheet for using it to Struts2.


Solution

  • USe simple theme

    <s:textfield theme="simple" value="" required="true" name="userBean.userName"></s:textfield>
    

    struts2 by default puts table with class="wwFormTable" around your forms and tags.You can either modify that css class or use simple theme as given above