Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have one content editor webpart, in the document library view page which freezes the header row. It works fine when using it in SharePoint 2010 environment. But when I moved that CSS to SharePoint 2013 CEWP it effects nothing in page.

My CEWP in SP2010 contains following code (thanks goes to Mr.AmitKB - a SharePoint.stackexchange user) :

<style type="text/css">
.fh-outerWrapper {
    POSITION: relative
}
.fh-tableWrapper {
    OVERFLOW: auto; HEIGHT: 300px
}
.fh-thRow .fh-thContentWrapper {
    POSITION: absolute; TOP: 0px
}
.fh-bg {
    HEIGHT: 30px; POSITION: absolute; TOP: 0px; WIDTH: 100%; BACKGROUND-COLOR: #d5ecff
}</style><script type="text/javascript">




$(function(){

// Get table reference
// TODO: apply your selector to select the table
var $table = $("#onetidDoclibViewTbl0");

// Get table's header row reference
var $hdr = $("tr.ms-viewheadertr:first", $table);

// Wrap table in div
$table.wrap("<div class='fh-tableWrapper' />");

// Wrap the table's wrapper in another div
// This is top most wrapper for fixed header table
$('.fh-tableWrapper').wrap("<div class='fh-outerWrapper' />");

// Now add another div within top most wrapper
// to acts as header background
$('.fh-outerWrapper').prepend("<div class='fh-bg' />");

// Put content of each table's header colmumn 'th'
// value/data in a div, so that it abosolute position is
// applied to it
$('th',$hdr).wrapInner("<div class='fh-thContentWrapper'/>");

// Add css class so that styling can be applied
$hdr.addClass("fh-thRow");
$table.addClass('fh-table');

});</script>

But when I put the same code in the SharePoint 2013 CEWP, nothing affects.

What am I missing? Please help.

share|improve this question
1  
The markup probably has changed. Use IE Dev Tools or Firebug in Firefox to inspect the data. –  PirateEric Aug 23 at 15:26

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.