When javascript controls the display mode of table tr display block, it is only valid for the first cell.

Source: Internet
Author: User

When javascript controls the display mode of table tr display block, it is only valid for the first cell.

There is a simple table:

 

 
No. Type Details Creation Time Modification time Operation
5 TECH Test content 2014? 01? 10 16:56:31 ?? Modify and delete
Test content

 

You want to use javascript to control the hidden status of tr in the third line:

var tr_modifing = document.getElementById( "id_dync" );tr_modifing.style.display = "block";

 

After you set style. display to block, it will only be valid for the first cell td:

The reason is to set tr. style. after the display = "block", the tr is not a normal [Table] [row], but a common block like a common div, so the following

 

 

It will also become invalid. The correct method is

var tr_modifing = document.getElementById( "id_dync" );tr_modifing.style.display = "";

 

The display mode of tr is set to null. This attribute dispaly is not followed by anything. It is strange that it is compatible with Firefox and IE.

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.