如题,在运用struts2的<s:select>标签后,下拉列表框总是会换行处理,我先贴出jsp源码出来,不知道大家在使用过程中有没有类似的问题,多谢各位了
      <td class="cpx12black" height=27 colspan="2">
        &nbsp;状态:
                  <s:if test="#application.adminState!=null">
                <s:select name="user_state" list="#application.adminState" listKey="meaning" listValue="name" headerKey="" headerValue="-请选择-"/>
       </s:if>
      </td>
我将文字和下拉列表框方如一个div也不行,如下:
      <td class="cpx12black" height=27 colspan="2">
        &nbsp;状态:
        <div style="height:auto">
<s:if test="#application.adminState!=null">
       <s:select name="user_state" list="#application.adminState" listKey="meaning" listValue="name" headerKey="" headerValue="-请选择-"/>
       </s:if>
       </div>
      </td>
求救....  :-) 

解决方案 »

  1.   

    放两个td里 <td class="cpx12black" height=27 colspan="2">  &nbsp;状态:</td><td> <div style="height:auto">  <s:if test="#application.adminState!=null">  <s:select name="user_state" list="#application.adminState" listKey="meaning" listValue="name" headerKey="" headerValue="-请选择-"/>  </s:if>  </div>  </td>
      

  2.   

    <s:select theme="simple" name="user_state"
    xiaoye2892 兄,你好,我添加了theme属性,界面是有所变化,换行的间距变小了一点,但是还是没有解决换行的问题,不知是否还有其他地方需要修改?
      

  3.   

    你如果是要把状态这两个字和select放在一行的话 就在select中加入 label="状态"
      

  4.   


    noWrap 设置或获取浏览器是否自动执行换行。  weeping_wine 兄,td的这个属性行不通,多谢  :-)
      

  5.   

    xiaoye2892 兄,你好,<s:select 的 label 属性可以,但是我有一个疑问,如下:
    <s:select label="<s:text name='monthmotherList.query_state'/>" 
    为何读取不到资源文件的值,系统直接把"<s:text name='monthmotherList.query_state'/>" 显示出来了,求解....谢谢
      

  6.   

    多谢 totaka 兄,用两个td来控制直接就搞定了。  :-)
      

  7.   

    label= "%{getText('monthmotherList.query_state')}"
      

  8.   

    totaka
      

  9.   


    呵呵,提醒一下后者,用TD解决的同时还需要加入theme="simple"属性来配合使用。