How to change label width beyond 250 px. in MS CRM
December 17, 2010 by Geron Profet · Leave a Comment
Sometimes you want to create a questionnaire in MS CRM. See example:
However, in MS CRM the max label width within a section is 250 pixels. Fortunately, Mitch Milam found an interesting (unsupported) way how to increase the label width beyond 250 pixels.
Follow the procedure below to change your column label width:
Step-by-Step
- Create a new section
- Click on tab Formating and select Fixed Width
- Choose Two Columns (2:1).
For some reason it only works with this Column Format and since it met my needs I didn’t bother to investigate why. - Enter a section name and click OK.
- Paste the function below in the OnLoad event and see example how to call it.
//****************************************************
function gResizeLabel(fieldname, labelcolwidth, datacolwidth){
/*
This function is used to increase to label width beyond 250 pixels in order to simulate a questionnaire
Params: fieldname - name of the field
labelcolwidth - width of the label cloumn in pixels (e.g. 60%)
datacolwidth - width of the data column in pxels (e.g. 40%)
Returns: nothing
Calls: nothing
Designed by: Geron Profet
Org. Design: Mitch Milam
Example: gResizeLabel('emailaddress1', '60%', '40%');
*/
if (document.getElementById(fieldname+'_c')){
var tableObj = document.getElementById(fieldname+'_c').parentNode.parentNode.parentNode;
if (tableObj){
var col0 = tableObj.getElementsByTagName("col")[0];
var col2 = tableObj.getElementsByTagName("col")[2];
col0.width = labelcolwidth;
col2.width = datacolwidth;
}
}
}
//Now call the function
gResizeLabel('emailaddress1', '60%', '40%');

