你把edt 宽度设为100%了,后面的当然要换行了

解决方案 »

  1.   

    <table bgcolor="#ECE9D8"> 
      <tr>
        <td width="300">
    <table width="100%" border=0>
    <tr>
    <td align="right" width="100%">
    <input id="edt"  type="text" value="cdcdcd" style="width:100%">
    </td>
    <td align="right"><input id="btn1" type="button" value="ssss" onclick="ins();" ><input id="btn2" type="button" value="rrrr" onclick="ins();" >
    </td>
    </tr>
    </table>      
        </td>
      </tr>
    </table>
      

  2.   

    一定要 分成多个 td 或嵌套 table 吗?
      

  3.   

    <input id="edt"  type="text" value="cdcdcd" style="width:10;overflow:visible" />
      

  4.   

    菜鸟问:style="width:10;overflow:visible",将width设成10,岂不是很小?overflow是设置它的什么属性?
      

  5.   

    10是小了点,overflow是设置对象的内容超过其指定高度及宽度时如何处理
    visible:可以看到
    auto:自动处理
    hidden:隐藏
    scroll滚动条
      

  6.   

    style="width:10;overflow:visible",将width设成10,岂不是很小?小不小你运行就知道了
    <input id="edt"  type="text" value="cdcd谁说10小?????????cd" style="width:10;overflow:visible" />
      

  7.   

    楼上的,用样式表来解决,不错,我临时为搂主 写了个javascript程序,测试通过
    <html><head>
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 1</title>
    <script language=javascript>
        function resize_textbox(){
           var obj;
           for(i=0;i<document.myform.elements.length;i++){
              obj = document.myform.elements[i];
              if (obj.type=="text"){
                  obj.style.width="100%";
              }      
           }
        }
    </script></head><body onresize="javascript:resize_textbox()" onload="javascript:resize_textbox()"><form name=myform action="">
     <table border="1" width="100%">
    <tr>
    <td width="134">姓名</td>
    <td><input type="text" name="T1" size="20"></td>
    </tr>
    <tr>
    <td width="134">职业</td>
    <td><input type="text" name="T2" size="20"></td>
    </tr>
    <tr>
    <td width="134">毕业学校</td>
    <td><input type="text" name="T3" size="20"></td>
    </tr>
     </table>
    </form></body></html>
      

  8.   

    多谢各位,不过基本没有解决问题 :-(net_lover(孟子E章) 写的只是input能随输入自动增大,甚至能把td 撑大,
    我并不是要这样的效果。我只是希望当td的宽度给定的情况下,页面显示后,
    里面的一个text input + 多个button input 能不换行地充满td,就象这种效果:(file 的“浏览”按钮是不会换到下一行的)<table bgcolor="#ECE9D8"> 
      <tr>
        <td width="300">
          <input id="fileup"  type="file" value="" style="width: 100%;" />
        </td>
      </tr>
    </table>
      

  9.   

    晕啊!灵活运用表格啊?不要告诉我无法限制外围表格宽度啊。<html>
    <head>
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 1</title>
    <script language=javascript>
        function resize_textbox(){
           var obj;
           for(i=0;i<document.myform.elements.length;i++){
              obj = document.myform.elements[i];
              if (obj.type=="text"){
                  obj.style.width="100%";
              }      
           }
        }
    </script></head><body onresize="javascript:resize_textbox()" onload="javascript:resize_textbox()"><form name=myform action="">
     <table border="1" width="100%">
    <tr>
    <td width="134">姓名</td>
    <td>
       <table width=100% border=0>
         <tr>
            <td><input type="text" name="T1" size="20"></td>
            <td width=40><input type=button value='啊呀'></td>
            <td width=40><input type=button value='啊呀'></td>
         </tr>
       </table>
    </td>
    </tr>
    <tr>
    <td width="134">职业</td>
    <td>
       <table width=100% border=0>
         <tr>
            <td><input type="text" name="T2" size="20"></td>
            <td width=20><input type=button value='啊'></td>
            <td width=40><input type=button value='啊呀'></td>
            <td width=60><input type=button value='啊呀呀'></td>
         </tr>
       </table>
    </td>
    </tr>
    <tr>
    <td width="134">毕业学校</td>
    <td>
       <table width=100% border=0>
         <tr>
            <td><input type="text" name="T2" size="20"></td>
            <td width=20><input type=button value='啊'></td>
            <td width=40><input type=button value='啊呀'></td>
            <td width=60><input type=button value='啊呀呀'></td>
            <td width=80><input type=button value='啊呀呀呀'></td>
         </tr>
       </table>
    </td>
    </tr>
     </table>
    </form></body></html>这总满意了吧
      

  10.   

    to valley74:嘿嘿,不是我不厚道,你写的代码确实可以解决问题,
    不过我是问“能否通过设置style实现?”,table中套table容易解决,
    不用呢?就象我上面说的
    <table bgcolor="#ECE9D8"> 
      <tr>
        <td width="300">
          <input id="fileup"  type="file" value="" style="width: 100%;" />
        </td>
      </tr>
    </table>
    这个例子(后面的“浏览”按钮不会换行)。
    不过还是十分感谢你以及各位的热心回复。
      

  11.   

    <table bgcolor="#ECE9D8" width="300"> 
      <tr>
        <td width=100% nowrap >
          <input id="edt"  type="text" value="cdcdcd" style="width: 100%;" />
        </td>
        <td nowrap >
          <input id="btn1" type="button" value="ssss" onclick="ins();" />
          <input id="btn2" type="button" value="rrrr" onclick="ins();" />
        </td>
      </tr>
    </table>
      

  12.   


    <table bgcolor="#ECE9D8"> 
      <tr>
        <td width="300" nowrap align=right >
          <input id="edt"  type="text" value="cdcdcd" style="width:expression(this.nextSibling.nextSibling.offsetLeft-10);" />
          <input id="btn1" type="button" value="ssss" />
          <input id="btn1" type="button" value="ssss" />
          <input id="btn2" type="button" value="rrrr"  />
        </td>
      </tr>
    </table>