Adjust the column widths/wrap text in the Quick Edit/Datasheet view

Forums General discussion Adjust the column widths/wrap text in the Quick Edit/Datasheet view

This topic contains 3 replies, has 2 voices, and was last updated by  Alexander Bautz 6 months, 1 week ago.

  • Author
    Posts
  • #16701

    Roberto Garcia
    Participant

    Hi Alex.. like always “Thanks for all your help and support”.. I need a huge favor.

    I am trying to find a way adjust the column widths/wrap text in the Quick Edit/Datasheet view in SharePoint 2013.

    So far, I have only seen ways to adjust the widths in the standard view (using CSS), but these seem to not get applied to the Quick Edit or Datasheet view.

    I am including you an image of the example. In this particular case i have a Datasheet view that it always open in “Quit Edit or Datasheet View” when the users want extra space to see that they are typing, in this particular case “Scope” is the column that i wan to adjust the width, i just cant do it.

    Thanks in advance and i hope you can answer me back. Have a great day.

    Attachments:
  • #16713

    Alexander Bautz
    Keymaster

    Hi,
    You can try adding this to a script editor web part below the list view:

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script>
    setTimeout(function(){
        jQuery("th[title='Scope']").css("width","400px");
    },2000);
    </script>

    Alexander

  • #16732

    Roberto Garcia
    Participant

    Afternoon Alex

    Sorry to bother you again (sorry), it didnt work, do you may know why? i put it at the end in a Script editor, it didnt give me any error or so but it didnt affect the column width at all. Then i put it at the beginning just to check if comes with a different result and it didnt either.

    Huge favor, do you have another suggestion? you would save my life if i can make this to happen.

    Thanks again
    RG

  • #16772

    Alexander Bautz
    Keymaster

    Hi,
    Sorry for the delay. It’s hard to tell what it could be – the above code has been tested in an Office 365 site, but it might be that the timeout isn’t long enough to let the list view finish rendering.

    Try changing it like this:

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script>
    setInterval(function(){
        jQuery("th[title='Scope']").css("width","400px");
    },2000);
    </script>

    This will run the snippet every 2 seconds – not 100% ideal, but it should work.

    Alexander

You must be logged in to reply to this topic.