We a custom field which is a multi select text field and wiki rendered,
We have added an AJS code as html as below,
<script> AJS.$(document).ready(function() {AJS.$("#rowForcustomfield_10503").css({"width":"130%"});AJS.$('.confluenceTable').find('tr').each(function() {var tds = AJS.$(this).find('th');var len = tds.length;for (var i = 0; i < len; i++) { AJS.$(tds[i]).css('text-align', 'center'); AJS.$(tds[i]).css('color', 'white'); AJS.$(tds[i]).css('background-color', '#5F5F5F '); } });window.alert("Hi");var ths = AJS.$("table tbody tr").find("th");var len = ths.length;for (var i = 0; i < len; i++) {AJS.$(ths[i]).css({"width":"1px","white-space":"nowrap"});}AJS.$('.confluenceTable').find('tr').each(function() {AJS.$(this).css('background-color', '#F2F2F2 ');AJS.$(this).css('background-color', '#F1F1F1 ');var tds = AJS.$(this).find('td');var len = tds.length;for (var i = 0; i < len; i++) {AJS.$(tds[i]).css('text-align', 'center');AJS.$(tds[i]).css('color', 'black');AJS.$(tds[i]).css({"width":"1px","white-space":"nowrap"});} });
It was coming with wrapping and misaligned. Hence we ran it in console and it worked, the custom field came no wrapped and worked fine. We have added a window.alert("Hi") to test and it displayed when run in console and when we edited the custom field.
BUT not while loading page. Please help