Loading...
Copy code
Close
Permalink
Close
Please tell us why you want to mark the subject as inappropriate.
(Maximum 200 characters)
Report Inappropriate
Cancel
Private Message
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Cancel
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Update
Cancel
Feedback
Email ID
Subject :
Comments :
Send
Cancel
Private Message
Type the characters you see in the picture below.
Type the characters you see in the picture below.
Attach files
Desktop
Google Docs
Each Attachment size should not exceed 1.0 MB.
Max no of attachments : 3
Loading User Profile...
guest
Response title
This is preview!
Attachments
Publish
Back to edit
Cancel
(
)
Sign In
New to this Portal? Click here to
Sign up
You can also use the below options to login
Login with Facebook
Login with Google
Login with Yahoo
jQuery
Plugins
UI
Meetups
Forum
Blog
About
Donate
All Forums
Recent Posts
Log In
Search
jQuery
Search
jQuery Forum
Move this topic
Forum :
Getting Started
Using jQuery
Using jQuery Plugins
Using jQuery UI
Developing jQuery Core
Developing jQuery Plugins
Developing jQuery UI
QUnit and Testing
About the jQuery Forum
jQuery Conferences
jQuery Mobile
Developing jQuery Mobile
Sub forum :
Move this topic
Cancel
Using jQuery
JonasAnde..
Access and hide column only for outer table
in
Using jQuery
•
3 years ago
I have an outer table and want to hide second column, but not for the inner tables.
$('.table-main td:nth-child(2)').hide();
The problem here is that all the inner tables second columns hides as well.
So how can I just hide the outer table called table-main and not all the tables within?
1
Reply
Replies(4)
watusiware
Re: Access and hide column only for outer table
3 years ago
$('.table-main >td:nth-child(2)').hide();
will get you only the direct children.
You might want to learn more about CSS selectors:
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors
... and their use with jQuery:
https://learn.jquery.com/using-jquery-core/selecting-elements/
Leave a comment on watusiware's reply
JonasAnde..
Re: Access and hide column only for outer table
3 years ago
Thanks!
Leave a comment on JonasAndersson's reply
watusiware
Re: Access and hide column only for outer table
3 years ago
Actually, it will have to be:
$('.table-main >tbody td:nth-child(2)')
You will need more if your table has headings.
$('.table-main >thead td:nth-child(2),table-main >tbody td:nth-child(2)')
Your didn't post your HTML, so I have to guess.
Leave a comment on watusiware's reply
JonasAnde..
Re: Access and hide column only for outer table
3 years ago
It turned out that I had to do it this way:
$('.table-main > tbody > tr > td:nth-child(2n)').hide();
Maybe some other approach would have worked as well, but this did the trick.
Leave a comment on JonasAndersson's reply
Change topic type
Topic Type :
Discussions
Questions
Ideas
Problems
No of days :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Change topic type
Cancel
Link this topic
Provide the permalink of a topic that is related to this topic
Permalink
Save
Close
Reply to JonasAndersson's question
Top
Reply
{"z57234473":[14737000007813044,14737000007813049,14737000007820043],"z7664639":[14737000007814029,14737000007814045]}
Statistics
4
Replies
733
Views
0
Followers
Tags
No tags available for this topic.
Cancel
Actions
Permalink