10

I created a new list view with style = 'Boxed' in SP2013. The problem is that this view is showing the columns header in the top when there's no need to do it. So, how can I remove or hide it? I tried associating a js file where I'm loading jQuery and doing the following:

$('.ms-listviewtable tr th').hide();

But if after loading jQuery, the Boxed style doesn't work anymore. Any ideas?

3
  • i checked and it's working fine.. i think your javascript loads before. try to apply delay to your javascript and check... Dec 23, 2013 at 13:17
  • It didn't work for me. I'm executing the command after loading jQuery, but when the jQuery script has been loaded the boxed style doesn't work anymore, strange isn't it? Dec 24, 2013 at 10:47
  • yes, you can also hide by applying css... Dec 24, 2013 at 10:52

3 Answers 3

13

Probably the most simple way to hide View header would be to use CSS

1 Add Content Editor web part on View page (located under Media & Content category)

2 Insert the following code into Content

<style type="text/css">
    .ms-viewheadertr { display:none; }
</style>

enter image description here

5
  • 1
    Works like a charm! :D Dec 24, 2013 at 10:49
  • Glad to know :) Dec 24, 2013 at 11:50
  • 1
    That worked perfectly for my SP2013 list in boxed view! I don't get why Microsoft took the split view/edit capability out of SP Designer 2013... - Thanks!!!
    – user31782
    Jul 22, 2014 at 16:02
  • Works like a charm until I publish the page, <style type="text/css"> .ms-viewheadertr { display:none; } </style> After publishing it looks like.... <style type="text/css"> <span id="ms-rterangecursor-start"> </span> <span id="ms-rterangecursor-end"></span> tr.ms-{;} </style><span id="ms-rterangecursor-start"></span> <span id="ms-rterangecursor-end"></span> Aug 19, 2014 at 10:26
  • Wonderful! Be sure to use a good Title for the Content Editor web part that houses your CSS in the HTML source - or months later when you return to this webpart, and see no content in the CE, you'll wonder why it's there and perhaps delete it. Set the title to something like: Edit HTML Source CSS to Hide Column Headers and then set the Chrome Type to none in the Web Part's Appearance settings. The title will show when you are in web-part edit mode, but not in display mode, so nobody else will see it but you.
    – bgmCoder
    Dec 21, 2017 at 3:37
3

To hide specific WebPart's column headers

#WebPartWPQ6 .ms-viewheadertr
  {
   display: none;
   }

.... where replace WebPartWPQn with your web part ID.

0

I have the same issue that once I publish the page the feature stops working.

I solved it by adding a Script Editor Web Part and adding the code Vadim posted there.

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.