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>
原文地址:https://www.cnblogs.com/alisayuan/p/4788665.html