input type='button'里面的文字换行

在网上找到这样一段代码:<input type="button" value="测试&#13;&#10;文字">

      我给它定义了一个class,“buttonstyle”,样式如下

      

?
1
2
3
< style  type = "text/css" >
     .buttonstyle{width:50px;height:50px;}
</ style >

      它在IE8、火狐、谷歌下面的效果是OK的,截图如下:

       

      在IE6、IE7下面的效果图如下:

       

      经调试,只要给buttonstyle加一个padding就行了,只要调一下左右的值就OK,我这里的值是padding:2px 9px;最重要的是调后面的9px。最后IE6的效果如下:

        

       但是郁闷的是,opera似乎不支持这个效果,不过总的来说,用我这种方法能兼容IE6 7 8  9,火狐,谷歌,应该也算差不多了。

table { border-collapse: collapse; width: 100%; } td, th { border: 1.5px solid black; padding: 5px; } table img { max-width: 150px; height: auto; } <!-- //图片大小调整 --> .popup { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.8); display: flex; align-items: center; justify-content: center; } .popup img { max-width: 100%; max-height: 100%; cursor: zoom-out; } .sticky-header { position: sticky; top: 0; background-color: #f5f5f5; /* 可根据需要设置背景色 */ } <!-- //放大图片设置 --> </style> </head> <body> <div> <button onclick="addRow()">新增一行</button> <button onclick="addColumn()">添加一列</button> <button onclick="deleteRow()">删除行</button> <button onclick="deleteColumn()">删除列</button> <button onclick="changeSize()">调整大小</button> <div> <div id="popup" class="popup" style="display: none;"> <img id="popupImg"> </div> <table id="myTable"> <thead class="sticky-header"> <tr> <td contenteditable="true"><input type="text" oninput="filterTable(0)" placeholder="工艺膜层"></td> <td contenteditable="true"><input type="text" oninput="filterTable(1)" placeholder="AOI Step"></td> <td contenteditable="true"><input type="text" oninput="filterTable(2)" placeholder="不良类型"></td> <td contenteditable="true"><input type="text" oninput="filterTable(3)" placeholder="Layer(Code)"></td> <td contenteditable="true"><input type="text" oninput="filterTable(4)" placeholder="Type"></td> <td contenteditable="true"><input type="text" oninput="filterTable(5)" placeholder="Dpet"></td> <td contenteditable="true"><input type="text" oninput="filterTable(6)" placeholder="Subcode"></td> <td contenteditable="true">Code描述</td> <td contenteditable="true">Image1</td> <td contenteditable="true">Image2</td> <td contenteditable="true">Image3</td> <td contenteditable="true">Image4</td> <td contenteditable="true">Image5</td> <td contenteditable="true">Image6</td> <td contenteditable="true">判定细则</td> </tr>这个表格中怎么调整列宽
07-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值