0

Here's what I'm trying to do: I have a list where I'm trying to enlarge the width of two particular columns.
Here's the JS that I'm attempting to put into use:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script> 
<script type="text/javascript">
 $(document).ready(function()
 {
 $("TH.ms-vh2:contains('Description')").css("width", "300px"); 
 $("TH.ms-vh2:contains('Analysis')").css("width", "200px"); 
 });
 </script>

However, the above code isn't having any effect when I use a Content Editor Web Part on the same page, and refer to this js file in the Site Assets folder. The columns stay the same size. What am I doing wrong?

  • UPDATE: I was actually able to make it work using a different approach to the code. – DanJ Feb 25 at 20:11
0

UPDATE: I was actually able to make it work using a different approach to the code.

.ms-vh-div[DisplayName='Description']
{
  width:250px;
}

...and so on. This seems to work properly.

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.