JQuery Using Show More Button And Html Table | Edureka Community
Có thể bạn quan tâm
I have a html table and at the end of each cell is a "show more" Button.
If you click on the "Show more" Button, a new row should come up with the hidden content.
My problem is, that if you click on the "Show More" Button, the hidden content will show up right under the same cell, instead of the left side.
This is how it is now: 
This is how it should be: 
Jquery:
<script type="text/javascript"> $(document).ready(function() { $(".productDescription").hide(); $(".show_hide").show(); $(".hide_show").hide(); $('.show_hide').click(function() { $(this).parent().find('.productDescription').slide Toggle(); $(this).parent().find(".show_hide").hide(); $(this).parent().find(".hide_show").show(); $(".productDescription").hide(); }); $('.hide_show').click(function() { $(this).parent().find('.productDescription').slide Toggle(); $(this).parent().find(".show_hide").show(); $(this).parent().find(".hide_show").hide(); $(".productDescription").hide(); }); }); </script>HTML:
<div class="table"> <div class="row header"> <div class="cell1">test</div> <div class="cell1">test</div> <div class="cell1">Test</div> <div class="cell1">test</div> <div class="cell1">test</div> <div class="cell1">test</div> <div class="cell1"></div> </div> <div class="row"> <div class="cell">Testentry</div> <div class="cell">Testentry</div> <div class="cell">Testentry</div> <div class="cell">Testentry</div> <div class="cell">Testentry</div> <div class="cell">Testentry</div> <div class="cell"> <a href="#" class="show_hide" id="1">Show More</a> <a href="#" class="hide_show" id="1">Hide</a> <div class="productDescription" id="1">This Content will show up</div> </div> </div> <div class="row"> <div class="cell">Testentry</div> <div class="cell">Testentry</div> <div class="cell">Testentry</div> <div class="cell">Testentry</div> <div class="cell">Testentry</div> <div class="cell">Testentry</div> <div class="cell"> <a href="#" class="show_hide" id="2">Show More</a> <a href="#" class="hide_show" id="2">Hide</a> <div class="productDescription" id="2">This Content will show up</div> </div> </div> <div class="row"> <div class="cell">Testentry</div> <div class="cell">Testentry</div> <div class="cell">Testentry</div> <div class="cell">Testentry</div> <div class="cell">Testentry</div> <div class="cell">Testentry</div> <div class="cell"> <a href="#" class="show_hide" id="3">Show More</a> <a href="#" class="hide_show" id="3">Hide</a> <div class="productDescription" id="3">This Content will show up</div> </div> </div> </div>CSS:
.table { margin: 0 0 40px 0; width: 100%; border-left:1px solid #dfdfdf; border-right:1px solid #dfdfdf; display: table; } @media screen and (max-width: 580px) { .table { display: block; } } .row { display: table-row; background: #f6f6f6; } .row:nth-of-type(odd) { background: #ededed; } .row.header { line-height: 25px; font-weight: 900; color: #ffffff; background: #566680; height:38px; margin-top:5px; } @media screen and (max-width: 580px) { .row { padding: 8px 0; display: block; } } .cell { padding: 6px 12px; display: table-cell; border-bottom:1px solid #dfdfdf; color:#566680; height:24px; line-height:25px; } @media screen and (max-width: 580px) { .cell { padding: 2px 12px; display: block; } } .cell1 { padding: 6px 12px; display: table-cell; } @media screen and (max-width: 580px) { .cell1 { padding: 2px 12px; display: block; } } }Any possibilities to do this?
Từ khóa » Html Fill Table Cell With Button
-
How To Make Button Fill Table Cell - Html - Stack Overflow
-
Make Button, Input Fill Entire Table Cell - CSS Widget
-
Scale Button To Div Height Table Cell - HTML Form How To
-
HTML : How To Make Button Fill Table Cell - YouTube
-
How To Make Button Fill Table Cell
-
HTML Button Fill Table Cell
-
Learn How To Style Block Buttons (full-width) With CSS. - W3Schools
-
: The Table Row Element - HTML - MDN Web Docs - Mozilla Putting A Button At The Bottom Of A Table Cell - HTML / CSS - Bytes
How To Add Button To Html Table Cell?
Html Create A Table With Add Row Button Code Example
Data Tables - Material Design
How To Use Tables (The Java™ Tutorials > Creating A GUI With ...
Link Button In A Table - Code Helper - Material Design For Bootstrap
Copyright © 2022 | Thiết Kế Truyền Hình Cáp Sông Thu