删除html表中新创建的行中单元格的边框

问题描述:

<

script type="text/javascript">
        function Addrow() {
            var table = document.getElementById("successFailure");
            var row = table.insertRow(2);
            var cell1 = row.insertCell();
            cell1.innerHTML = "Format and Store Type";
        }
    </script>










--From the list that i am getting from the controller, i am displaying the data in an html table.

for example

column1    column2    column3     column4
 uk           23        23           23
 x            11        11           45
 y            22        63           22
 z            11        35           46 

--but i needed an row at the second position without border

column1    column2    column3     column4
 uk           23        23           23
 format
 x            11        11           45
 y            22        63           22
 z            11        35           46 

--I did it on onload function. But i want to remove the border of the cell. As "format" is bordered in the first cell. I want to remove the border in the cell. So a blank row is needed 
with text as "format".

Kindly help.

默认情况下,没有任何边框。如果你看到一些边框,就意味着你把它们添加到了某个地方。



最好控制边框是使用CSS:

http://www.w3schools.com/css/css_border.asp [ ^ ],

http://www.w3schools.com/cssref/pr_border.asp [ ^ ]。



实际上,除了 class ,也应稀疏使用。您还可以在脚本中动态定义CSS类。



如果您需要动态更改某些元素的CSS类,最好的方法是正在使用jQuery: http://api.jquery.com/category/css [ ^ ]。



如果你需要学习jQuery(强烈推荐),请参阅:

http://en.wikipedia.org/wiki/ JQuery [ ^ ],

http://jquery.com [ ^ ],

http://learn.jquery.com [ ^ ],

HTTP://learn.jquery .com / using-jquery-core [ ^ ],

http://learn.jquery.com/about -jquery / how-jquery-works [ ^ ](从这里开始)。



-SA
By default, there are no any borders. If you see some borders, it means you added them somewhere.

The best to control borders is using CSS:
http://www.w3schools.com/css/css_border.asp[^],
http://www.w3schools.com/cssref/pr_border.asp[^].

Actually, you should not use any HTML tags related to styles except class, which also should be used sparsely. You can also define CSS classes on the fly in your scripts.

If you need to change the CSS classes of some element on the fly, the best way to do it is using jQuery: http://api.jquery.com/category/css[^].

If you need to learn jQuery (highly recommended), please see:
http://en.wikipedia.org/wiki/JQuery[^],
http://jquery.com[^],
http://learn.jquery.com[^],
http://learn.jquery.com/using-jquery-core[^],
http://learn.jquery.com/about-jquery/how-jquery-works[^] (start from here).

—SA