3

I have the same exact problem as related here

Calculated Column left align header

However, the solution suggested is inadequate. This would require me to manual add the web part to each list that I create. (I'm sure you can see why this is horrible)

Is there another way to attain this by maintaining the Number type output?

1
  • Are you allowed to edit the masterpage?
    – MdMazzotti
    Commented Mar 11, 2014 at 9:58

2 Answers 2

0

You could do something like this:

keeping the Number format, edit your formula to output something like:

="<span class='fixMyHead'>" & [Some field] "</span>"

Then, using jQuery:

$('.fixMyHead').each(function(){  
    $td = $(this).parents('td:first');   
    $td.closest('table').find('th').eq($td.index()).find('.ms-numHeader').css('text-align', 'left');
    $td.children(':first').css('text-align', 'left');
});
0

I did it this way with jquery...

$(document).ready(function(){
    $('.class name here:contains(text in the header))').html('<div style="width:100%; text-align:left;">text for the column header</div>');
});

alignment now on the left.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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