how to revert back to normal after display:none for table row

前端 未结 9 1042
迷失自我
迷失自我 2020-12-11 14:42

Basically, I have a table. Onload, I set each row of the table to display:none since I have a lot of javascript processing to be done and I don\'t want user to

9条回答
  •  难免孤独
    2020-12-11 14:58

    I was unable to comment, which seems counterproductive. Ray's answer above also fixed my issue. I had a javascript to hide table rows where a search string does not match the contents of one of the cells.

    The example javascript code I used had display = "block" for the rows which remain displayed (display = "none" for the rows to hide).

    My search result left only the matching rows displayed, but lost the table formatting, so that all the TDs ran together instead of being formatted in columns. So the table started out with the correct columns, but lost them as soon as the search changed the display property.

    Simply changing display = "block" to display = "" fixed it.

提交回复
热议问题