开发者

setting width of column - sharepoint

I have a sharepoint list and t开发者_如何学编程he phone number field is in the format ###-###-#### and it ends up going to 2 lines. How can I set a width on that particular column? Do I need to do it from sharepoint designer?


there is no way to do this out of the box. Have to use sharepoint designer or jquery. Check out this msdn post

http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/f99303bb-6a95-4c05-951c-ff0185c4e864


This can be done via the xsltlistform webpart. drop it into the page in sharepoint and connect it to your list and move the columns around as needed.

Note: this is not the same as modifying the view, which as titan said is not available out of the box without opening the view page in sharepoint designer and modifying the xslt directly.


Best way is to use Alt+0160 Hard Space. Just type it once and copy this "Space" and paste as many you want!! Bingo!!


In SharePoint Designer 2010 I was able to modify column widths by opening the view I wanted to adjust, then lengthening the with of the column Title Field simply by dragging the field's box bigger.

This worked for what I was doing, but I noticed with some columns it affected others, I guess because they shared the same styling? I don't know enough to be certain.


<style>
/* new class created */
.ms-longg
{
width:500px
}

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

//removed existing class 

$('input[title^="State"]').removeClass('ms-long');

//add New class for that textbox

$('input[title^="State"]').addClass('ms-longg');


});
</script>

Click here see more details


you can also use the below script to expand the width of specific column. Just edit the page then add script editor web part and add below code.

note: the column name is the internal name.

     <script        src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js">/script>
    <script language="javascript" type="text/javascript">
           jQuery(document).ready(function() {
              var el = document.getElementsByName("<internal column name>");
              el[0].style.width ="<size>";
           });
     </script>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜