2

I have added an announcement list App inside my SharePoint 2013. But I am facing a layout problem, when the user clicks on an announcement item. The body field will be vertically aligned and most of the horizontal area will be blank, as follow:-

enter image description here

So is there way to manage my page layout so that the Body field will expand horizontally , baring in mind that the alignment of the body field will be better inside the “all item” view as follow:-

enter image description here

2

You should be able to do it with jquery. simething like $

(document).ready(function(){
 GetDisplayFieldByTitle= function (title) {
        var stringToFind = '<!-- FieldName="' + title + '"';
        var formFields = $('td.ms-formbody');
        var foundItem;
        $(formFields).each(function (item) {
            if (formFields[item].innerHTML.indexOf(stringToFind) > -1) {
                foundItem = $(formFields[item]);

            }
        });
        if (!foundItem)
            alert("An td with a class of ms-formbody containg the text " + stringToFind + " was not found");
        return foundItem;
    };
GetDisplayFieldByTitle('Body').attr("width","100%")

});

I use that function in 2010 alot, but it should work in 2013.

Or you could look into Client Side Rendering in 2013, Or Custom Rendering templates but these would be more work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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