Tooltip in table

Size
3,713 Kb
Views
46,552

How do I make an tooltip in table?

Experiment to bring tooltips to tables. What is a tooltip in table? How do you make a tooltip in table? This script and codes were developed by Jonathan De Montalembert on 10 July 2022, Sunday.

Tooltip in table Previews

Tooltip in table - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>tooltip in table</title> <script src="http://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ body { font-family: 'Arial', sans-serif; background: #444;
}
.bs { box-sizing: border-box;
}
table { background: white; margin: 20px auto; width: 70%; text-align: center;
}
table thead tr { border: 1px solid #3498db;
}
table thead td { background: #3498db; font-family: 'Open Sans', sans-serif; font-weight: 500; color: white; padding: 15px 10px; font-size: 1.2em;
}
table tbody { border-left: 1px solid #ddd; border-right: 1px solid #ddd;
}
table tbody tr { border-top: 1px solid #ddd;
}
table tbody tr:first-child { border: none;
}
table tbody tr:hover { background: #eee;
}
table tbody td { height: 25px; vertical-align: middle;
}
table tbody td:nth-child(3n+1) { padding: 10px 0 10px 10px;
}
table tbody td:nth-child(3n) { padding: 10x 10px 10px 0;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <table> <thead> <tr> <td> Name </td> <td> Age </td> <td> Location </td> </tr> </thead> <tbody> <tr class='tip' data-content='hello'> <td> Jon </td> <td> 28 </td> <td> Paris </td> </tr> <tr class='tip' data-content='Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.'> <td> Martel </td> <td> 1000 </td> <td>Nowhere</td> </tr> <tr class="tip" data-content="boring tooltip"> <td> Hermes </td> <td> 120 </td> <td> Olympus </td> </tr> <tr class="tip" data-content="this dude is weird"> <td> John Doe </td> <td> Unknown </td> <td> Unknown </td> </tr> <tr class='tip' data-content='hello'> <td> Jon </td> <td> 28 </td> <td> Paris </td> </tr> <tr class='tip' data-content='Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.'> <td> Martel </td> <td> 1000 </td> <td>Nowhere</td> </tr> <tr class="tip" data-content="boring tooltip"> <td> Hermes </td> <td> 120 </td> <td> Olympus </td> </tr> <tr class="tip" data-content="this dude is weird"> <td> John Doe </td> <td> Unknown </td> <td> Unknown </td> </tr> <tr class='tip' data-content='hello'> <td> Jon </td> <td> 28 </td> <td> Paris </td> </tr> <tr class='tip' data-content='Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.'> <td> Martel </td> <td> 1000 </td> <td>Nowhere</td> </tr> <tr class="tip" data-content="boring tooltip"> <td> Hermes </td> <td> 120 </td> <td> Olympus </td> </tr> <tr class="tip" data-content="this dude is weird"> <td> John Doe </td> <td> Unknown </td> <td> Unknown </td> </tr> <tr class='tip' data-content='hello'> <td> Jon </td> <td> 28 </td> <td> Paris </td> </tr> <tr class='tip' data-content='Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.'> <td> Martel </td> <td> 1000 </td> <td>Nowhere</td> </tr> <tr class="tip" data-content="boring tooltip"> <td> Hermes </td> <td> 120 </td> <td> Olympus </td> </tr> <tr class="tip" data-content="this dude is weird"> <td> John Doe </td> <td> Unknown </td> <td> Unknown </td> </tr> </tbody>
</table> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Tooltip in table - Script Codes CSS Codes

body { font-family: 'Arial', sans-serif; background: #444;
}
.bs { box-sizing: border-box;
}
table { background: white; margin: 20px auto; width: 70%; text-align: center;
}
table thead tr { border: 1px solid #3498db;
}
table thead td { background: #3498db; font-family: 'Open Sans', sans-serif; font-weight: 500; color: white; padding: 15px 10px; font-size: 1.2em;
}
table tbody { border-left: 1px solid #ddd; border-right: 1px solid #ddd;
}
table tbody tr { border-top: 1px solid #ddd;
}
table tbody tr:first-child { border: none;
}
table tbody tr:hover { background: #eee;
}
table tbody td { height: 25px; vertical-align: middle;
}
table tbody td:nth-child(3n+1) { padding: 10px 0 10px 10px;
}
table tbody td:nth-child(3n) { padding: 10x 10px 10px 0;
}

Tooltip in table - Script Codes JS Codes

$('.tip').hover(function(){ var content = $(this).data('content'); var klass = 'info'; var bound = this.getBoundingClientRect(); var tipEl = $('<div/>', { class: klass +' bs', html: content, css: { position:'absolute', top: bound.top + bound.height * 2 + window.pageYOffset, // the top of the item plus its height + scrolltop left: bound.left, width: bound.width, minHeight: bound.height + 1, background:'#eee', padding:'0 10px 5px 10px', opacity:0, border:'1px solid #ddd', borderTop:'none', color:'#444', lineHeight: '1.5em' } }); if(!$('.'+klass).length){ tipEl.appendTo(document.body); } tipEl.animate({opacity:1, top: bound.top + bound.height + window.pageYOffset}, 200); }, function(){ $('.info').remove(); });
Tooltip in table - Script Codes
Tooltip in table - Script Codes
Home Page Home
Developer Jonathan De Montalembert
Username roine
Uploaded July 10, 2022
Rating 3
Size 3,713 Kb
Views 46,552
Do you need developer help for Tooltip in table?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Jonathan De Montalembert (roine) Script Codes
Create amazing love letters with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!