In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today, I would like to share with you how jquery hides the relevant knowledge points of the table column. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look.
Methods: 1, use the find () and eq () methods to get the element object of the specified column according to the index value of the specified column, and the syntax is "tr element object. Find ('th or td element object: eq (index value)')"; 2, use the hide () method to hide the specified column, and the syntax is "specify column object .hide ()".
The operating environment of this tutorial: windows10 system, jquery3.2.1 version, Dell G3 computer.
How does jquery hide table columns
The find () method returns the descendant elements of the selected element.
The eq () method returns the element with the specified index number of the selected element.
The index number starts with 0, so the index number of the first element is 0 (not 1).
$(selector) .eq (index)
Index is required. Specifies the index of the element. Can be an integer or a negative number.
The hide () method hides the selected element.
$(selector) .hide (speed,easing,callback)
Speed is optional. Specifies the speed of the hiding effect.
Easing is optional. Specifies the speed of the element at different points in the animation. The default is "swing".
Callback is optional. The function to be executed after the hide () method is executed.
Examples are as follows:
$(document) .ready (function () {$(".btn1") .click (function () {$('tr'). Find (' th:eq (0)'). Hide (); $('tr'). Find (' td:eq (0)'). Hide ();}); $(".btn2") .click (function () {$('tr'). Find (' th:eq (0)'). Show () $('tr') .find (' td:eq (0)'). Show ();});}); Month Savings January $100January $100January $100Hidden display
Output result:
These are all the contents of the article "how jquery hides table columns". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.