tags:

views:

439

answers:

1

Hi, I am using struts 2.1.6 with ONGL. Please see the code below and tell me where should I define properties to <td> tag like width, height, bgcolor etc. in line no 3 and 4.

1) s:form action="Login">
2) <table>
3) <tr><s:textfield key="username"/></tr>
4) <tr><s:password key="password" /></tr>
5) </table>
6) </s:form>

A: 

<s:textfield> only creates a text field (input tag) and doesn't do td tags. You can insert them yourself (actually, you probably should, I don't think tr tags with straight content are legal?). In most cases it's considered better form to use CSS for styling and not resort to tables for layout, but that's another matter.

Edit: sorry I didn't think all this through. Basically, those tags are inserted by the struts theme. You can either set such things you want to set with CSS, or use the simple theme, this question in the docs should get you started.

wds
but this line <tr><s:textfield key="username"/></tr> is creatinf a header username and a textbox after that header.
vivmal