zoukankan      html  css  js  c++  java
  • js动态删除某一行,内容超出单元格后超出的部分用省略号代替

    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <script type="text/javascript" src="../lib/jquery.js"></script>
        <title></title>
        <style>
            table{
                table-layout:fixed;
                width:30%;
            }
            td{
                 white-space:nowrap;        
                  overflow:hidden;          
                  text-overflow:ellipsis; 
            }
        </style>
    </head>
    <body>
        <table id="sdktable" class="sdk-union-table" style="border-collapse:collapse" border="1">
            <tr id="symbol0">
                <td class="cname">明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息明天休息</td>
                
                <td><input type="button" value="delete" onclick="removeRow(this);" /></td>
    
            </tr>
        </table>
        <script>
            function removeRow(row) {
                var i = row.parentNode.parentNode.rowIndex
                document.getElementById('sdktable').deleteRow(i)
    
            }
            
        </script>
    </body>
    </html>
  • 相关阅读:
    添加unique约束
    设置自增列的步长和起始值
    创建外键及主键
    绘制折线图和叠加区域图
    绘制饼图
    生成叠加柱状图和水平柱状图
    随机生成带有颜色的验证码
    os模块与操作系统的交互
    TDate赋值给Variant时注意的问题
    线程中的异常处理
  • 原文地址:https://www.cnblogs.com/alisayuan/p/4788665.html
Copyright © 2011-2022 走看看