1

Is there a way to adjust the column widths or enable text wrapping in the Quick Edit or Datasheet view in SharePoint 2013?

I have seen ways to set widths in the standard list view (using CSS), but these do not seem to be able to change the width in Quick Edit mode.

2
  • Do you need to add any other coding above your code? and sorry i am not really good on this... What i did is put your code in a TXT file (Below code) .ms-spGrid-HeaderContentStyle div{ white-space: normal; } i saved it in the Site assets and copy the link/address. then in the list i add a Content edito webpart and i add this link but it didnt work. What i did wrong.. PS> you would save my life is you correct me in here "THANKS"
    – Roberto
    May 31, 2017 at 19:00
  • I saved mine as an HTML file: <style> .ms-spGrid-HeaderContentStyle div{ white-space: normal; } </style>
    – EvanC
    Jun 1, 2017 at 19:36

4 Answers 4

2

After a lot of searching, the following did the trick for me. This enables text wrapping in the Quick Edit view.

.ms-spGrid-HeaderContentStyle div{
white-space: normal;
}
2

Unfortunately, the answer provided didn't completely help my situation. We were able to use the CSS provided by EvanC to wrap the column headers but the column itself was still not adjusting. The following CSS to adjust the width of a multi-line field fixed what we needed.

.ms-rtestate-field{
      width: 100px;
 }

Thanks to EvanC for the original answer and pointing us in the right direction!

1

Use "th.ms-v2 div[DisplayName='Notes']..." for non-datasheet view. Use "th[Title='Notes']..." for datasheet view. Change "Notes" to the name of the field/column header that you want to modify.

<style>
th.ms-vh2 div[DisplayName='Notes']{
    min-width:350px !important;
    width:350px !important;
}
th[Title='Notes']{
    min-width:350px !important;
    width:350px !important;
}
</style>
2
  • What worked for me on the datasheet was: th[Title='Notes'] div .ms-spGrid-HeaderContentStyle{min-width:350px !important; width:350px !important;}
    – iDevPy
    May 3, 2021 at 21:40
  • If the suggestion box is not showing all the results from the suggested list, include the following line to fix it: .ms-taxonomy-suggestion-container .ms-taxonomy-suggestion-holder {height: auto !important}
    – iDevPy
    May 3, 2021 at 21:59
0

This code snippet enables textwrapping for both the Standard table view and the Quick edit view.

  1. Open your sharepoint page in edit mode
  2. Add a script editor web part (I placed mine above the list where I wanted the header text to be wrapped)
  3. Edit the scrip editor web part (button to the right of the web part)
  4. Insert the following code
<style> .ms-spGrid-HeaderContentStyle div{ white-space: normal; } </style>

<style type= "text/css">
.ms-vh, .ms-vh2-nofilter, .ms-vh2-nograd, .ms-vh2, .ms-vb
{white-space: normal}
</style>
  1. Click on Insert
  2. Save your changes "End editing" (the red button in the editing bar)

Works for me in Sharepoint 2016.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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