Tuesday, May 12, 2015

Changing the width of SharePoint list column

Changing the width of SharePoint list column is something that is not available out of the box. The solution is to add a javascript snippet in a content editor web part on the list view page.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript"></script>

<script type="text/javascript">
                $(document).ready(function(){

$('.ms-vh2-nograd:contains("Related Models")').css("width", "300px");

$('.ms-vh2-nograd:contains("Data Source IQDs")').css("width", "300px");


                });
</script>

No comments: