1

I am creating a list in sharepoint for my departments that will show their whereabouts throughout the week.

I have created a table in excel, imported it through sharepoint and everything regarding the functionality of the list is exactly how I would like it.

However, the list itself does not look aesthetically pleasing and I would like to format it, specifically I would like to add grid lines to the list to make it more readable and clearer.

Is there a way for me to do this? I have even considered editing the HTML code itself.

Any help would be much appreciated.

Frank

2

You can add Content Editor Web Part on list view.

Go to Settings (Upper right corner) >> Edit Page >> Select Add a Web Part" >> Media and Content >> Select Content Editor >> Click OK.

Add below CSS in Web Part's "Edit Source":

<style type="text/css">
table.ms-listviewtable tr:nth-child(2n+1) td, table.ms-listviewtable tr th {
        background-color: #efefef;
        /*border-bottom-color: #d5d5d5 !important;*/
        border-top-color: #d5d5d5 !important;
        border-width: 1px !important;
        font-family: "Open Sans",Tahoma,Arial,sans-serif !important;
        border-collapse: collapse !important;
    }

    table.ms-listviewtable tr:nth-child(2n) td, table.ms-listviewtable tr th {
        background-color: #f9f9f9;
        /*border-bottom-color: #d5d5d5 !important;*/
        border-top-color: #d5d5d5 !important;
        border-width: 1px !important;
        font-family: "Open Sans",Tahoma,Arial,sans-serif !important;
        border-collapse: collapse !important;
    }
    </style>

You can change css as per your requirements. Or else if you want this in each and every lists then you can attach css in master page.

  • Thank you very much Dikesh, just a couple of questions. When I follow your steps I finish with my original list, and then what appears to be a seperate web part above it and seperate to my list When I try to 'Edit source' in my list it is not an option. How do I integrate that CSS with an exisiting list? cheers Frank – FrankWhite Jan 5 '16 at 12:17
  • Select your content editor web part and you can see "Edit source". Add css into that. – Dikesh Gandhi Jan 5 '16 at 12:31
  • Yes, I have it now! Thank you Dikesh :) Maybe you can help with my next query. Is it possible to format, the very top row of my list. In order to distinguish between AM and PM, the top row reads; Monday Monday Tuesday Tuesday etc etc, However if possible I would like to merge the Mondays and tuesdays together. Thanks you kindly – FrankWhite Jan 5 '16 at 12:44
  • You can give different css to particular row. Or you can add JavaScript in content editor web part. – Dikesh Gandhi Jan 5 '16 at 12:47
0

Yeah , you can definitely change then look and feel of the share point list using Client side rendering (JS Link).

--> You can also apply Jquery Data table or Angular JS Data table as you want.

You can download the sample code of JS link .

Js link Demos

  • Thank you Dipen, is it possible to extract information from the list using a JS and use it on a different sharepoint page? – FrankWhite Jan 5 '16 at 13:55
  • Yes , using client side object modal you can get all the meta data regarding list and list items . and you can use it some where, – Dipen Shah Jan 6 '16 at 5:02
  • Great, thanks! do you have any links on how to do this? or could you give me some pointers? Cheers! Frank – FrankWhite Jan 6 '16 at 9:10
  • I have impliment Angular grid with list . i am sharing my blog for same codeplayandlearn.wordpress.com/2015/07/02/… – Dipen Shah Jan 6 '16 at 10:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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