laertejjunior / freezeheader Goto Github PK
View Code? Open in Web Editor NEWA simple jquery plugin to freeze header row in html table.
License: MIT License
A simple jquery plugin to freeze header row in html table.
License: MIT License
this patch fixes this issue:
--- jquery.freezeheader.js.orig 2013-12-07 01:43:04.192473929 +0100
+++ jquery.freezeheader.js 2013-12-07 01:52:37.213360271 +0100
@@ -104,10 +104,10 @@
tabela.append('<thead>' + obj.header.html() + '</thead>');
obj.container.append(tabela);
- obj.container.width(obj.header.width());
+ obj.container.width(obj.grid.outerWidth());
obj.container.height(obj.header.height);
obj.container.find('th').each(function (index) {
- var cellWidth = obj.grid.find('th').eq(index).width();
+ var cellWidth = obj.grid.find('th').eq(index).outerWidth();
$(this).css('width', cellWidth);
});
For my use, I have a static menu bar which is always at the top of the page. I need the header to show up below that, ~100px lower. Is there an easy way to adjust for this in the js file to compensate, and have it's starting point 100px lower?
Additionally, it should be "triggered" to start (show up) 100px sooner as well - as the true header gets hidden 100px sooner.
Thanks.
Hello, if the table doesn't fit horizontally in the screen, the horizontal scroll bar doesn't work. It shows only the first left columns. #2 talk about it, but I don't understand where to put that fix code?
As described, the header is migrating to the bottom of the table immediately upon the scroll bar being moved.
My HTML code for the table header is:
`
and the JS is:
$("#freeze").freezeHeader({ 'height': '300px' });
Suggestions?
Thanks/Bruce
Chemical group | Active ingredient | Product example | Diseases controlled |
---|
Respected Sir,
I have a common table in a jsp page. Based on the click of the tab the table content changes. Now i Have used freeezeheader which works only for the first time on page laod. Then on click of the tab the freezeheader does not work. Kindly help me on this.
Awaiting for ur reply at the earliest.
It would be good if there was a way to remove the freezeheader after it has been added.
It would be extremely useful to be able to specify an amount of space that should be maintained above the table--between the top of the table and the top of the viewing area, that is--so that room can be made (for example) for other things that we want to always be visible above the table.
The best term I can think of for this option is "headroom", although perhaps there's a better name.
/** Fix bug with resizing & horizontal*/
$(window).resize(function(){
if(copiedHeader){
$('#hd' + idObj).width($('#' + idObj).width());
}
fix_horizontal();
});
/**
* Fix bug with horizontal scroll
*/
$(window).scroll(function(){
fix_horizontal();
})
I use a style of "margin: auto" to cause my table to be centered in the viewport. However, the frozen header remains left aligned.
Any suggestions on how to fix this, or do it better?
You can also see it live at https://www.socalofficials.org/index.html?api/activeMemberStatus
I fixed it for you:
/** Fix bug with resizing */
$(window).resize(function(){
if($('#hd' + idObj).length){
$('#hd' + idObj).width($('#' + idObj).width());
}
});
Bug:
Try make big table, scroll down for see fixed header, and now, try change window width. See?
Hi, this little script saved my life many times, it would be awesome if you would improve it for table footers as well
var cellWidth = obj.grid.find('th').eq(index).width();
$(this).css('width', cellWidth);`
css('width') 和 width() 不完全一样
var cellWidth = obj.grid.find('th').eq(index).width();
$(this).width(cellWidth);`
var cellWidth = obj.grid.find('th').eq(index).css('width');
$(this).css('width', cellWidth);`
Hi
Do you have plans to support Bower/NPM for packaging?
Hi,
When using the freezeheader plugin, am facing an issue with the header slightly misaligned in Chrome and Safari browsers. The cloned header's width is not aligning properly. I'm using Bootstrap table, and the freezeheader plugin on top of that. It works fine in IE. If anyone could please help advise on this, would be extremely grateful. Thanks again.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.