Do you know how SharePoint determines the size of the Multiline Text type column for the list view? I don’t think SharePoint knows that either.
In essence, Multiline text columns, if there are several of them, seem to get their size from the heading text, so if the text is just one small word – then the entire column and it’s content will be all bunched up in a tiny little column.
In essence, Multiline text columns, if there are several of them, seem to get their size from the heading text, so if the text is just one small word – then the entire column and it’s content will be all bunched up in a tiny little column.
That’s not always convenient, so I thought it’d be cool to show you how you can control the size of the column using jQuery script.
Ensure you have a latest version of the jQuery file (in my case it’s jquery-1.10.2.js)
As always with these types of customizations, we will add a Content Editor Web Parton the top of the list view. The following is the code to be added to the web part.
Ensure you have a latest version of the jQuery file (in my case it’s jquery-1.10.2.js)
As always with these types of customizations, we will add a Content Editor Web Parton the top of the list view. The following is the code to be added to the web part.
<script src="/Shared%20Documents/jquery-1.10.2.js"></script>
<script language="javascript">
_spBodyOnLoadFunctionNames.push("AdjustColumnWidth");
function AdjustColumnWidth(){
$("div.ms-vh-div[DisplayName='BigColumn']").attr("style", "WIDTH: 550px");
$("div.ms-vh-div[DisplayName='Column1']").attr("style", "WIDTH: 550px");
$("div.ms-vh-div[DisplayName='Column2']").attr("style", "WIDTH: 550px");
}</script>
Above you will see three lines of code in the AdjustColumnWidth function:
$("div.ms-vh-div[DisplayName='Column2']").attr("style", "WIDTH: 550px");
See the part that has DisplayName=’Column2′, well change the “Column2” to whatever is the display name of your Multiline text column. You can also change the width to whatever is the pixel size that you need your column to be
Save the web part content and the page and that’s it!
The result speaks for itself:
Enjoy!
Ref: http://www.sharemuch.com/2014/03/18/how-to-change-the-size-of-the-column-in-sharepoint-list-view/
Ref: http://www.sharemuch.com/2014/03/18/how-to-change-the-size-of-the-column-in-sharepoint-list-view/