Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"HTML, CSS and Javascript in the editor tabs"
Bootstrap 4.1.1 Snippet by
VikasChaurasia264
4.1.1
jQuery
Preview
HTML
CSS
JS
View Full Screen
Fork
Fork this
2.0K
 
0 Fav
Post to Facebook
Tweet this
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <div class="container"> <div class="row"> <div class="table" width="100%" style="width:100%;"> <table id="tableone"> <thead> <tr> <th>Id</th> <th>Name</th> <th>Last Name</th> <th>Profile</th> <th>Profile Image</th> <th>Edit Profile</th> </tr> </thead> <tbody> <tr> <td>1</td> <td contenteditable="false">Johan</td> <td contenteditable="false">Johan Last</td> <td contenteditable="false">Profile</td> <td class= "text-center"><span class="user_profile_img"> <img src="https://tryitfreeapp.com/wp-content/uploads/2019/11/aboutUsImg.jpeg" class="rounded-circle" alt="User profile image" height="30px" width="30px"/> </span></td> <td class= "text-center"> <a href="javascript:void(0)" id="edit" class="btn"><i class="fa fa-edit"></i></a> <a href="javascript:void(0)" id="delete" class="btn"><i class="fa fa-trash" aria-hidden="true"></i></a> </td> </tr> </tbody> </table> </div> </div> </div> </div>
.fa-trash{color: red;} .btn:hover{cursor : pointer;}
$(document).ready(function () { $('#edit').click(function () { var currentTD = $(this).parents('tr').find('td'); if ($(this).html() == '<i class="fa fa-edit"></i>') { $.each(currentTD, function () { $(this).prop('contenteditable', true) }); } else { $.each(currentTD, function () { $(this).prop('contenteditable', false) }); } $(this).html($(this).html() == '<i class="fa fa-edit"></i>' ? '<i class="fa fa-save" aria-hidden="true" style="color: green;"></i>' : '<i class="fa fa-edit"></i>') }); $("#tableone").on('click', '#delete', function () { $(this).closest('tr').remove(); }); });
Related:
See More
Template
Paper Kit Pro
276.6K
84
Tabs style 1
237.0K
49
Bootstrap Tabs with Table
41.7K
8
Tabs
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76