I have an invisionfree forum and got permission from someone to edit a script so I can center the text on the advanced category bars. I don’t know much about html or java so I came here to get help. ?
Here’s the script ([URL=http://67.18.37.15/1183/88/upload/p6219332.ibf]url
[CODE]Div = document.getElementsByTagName(‘div’)
function CheckDiv(rDiv){
if(rDiv.getElementsByTagName(‘div’)[0].className == “maintitle”){
tDiv = rDiv.getElementsByTagName(‘div’)[0]
if(tDiv.getElementsByTagName(‘a’)[0]){
if(tDiv.getElementsByTagName(‘a’)[0].href.match(/index.php?c=(d+)/)){
ConstructGrads(rDiv,tDiv)
}
}
}
}
function ConstructGrads(rDiv,tDiv){
TableTCons = “<table width=’100%’ cellpadding=’0′ cellspacing=’0′ border=’0′>”
TableTCons += “<tr>”
TableTCons += “<td width=’1%’><img src='”+TopLeft+”‘ alt=” /></td>”
TableTCons += “<td width=’100%’ style=’background:url(“+TopMiddle+”)’>”+tDiv.innerHTML+”</td>”
TableTCons += “<td width=’1%’ align=’right’><img src='”+TopRight+”‘ alt=” /></td>”
TableTCons += “</tr>”
TableTCons += “</table><div class=’tableborder’>”
TableBCons = “</div><table width=’100%’ cellpadding=’0′ cellspacing=’0′ border=’0′>”
TableBCons += “<tr>”
TableBCons += “<td width=’1%’><img src='”+BottomLeft+”‘ alt=” /></td>”
TableBCons += “<td width=’100%’ style=’background:url(“+BottomMiddle+”)’></td>”
TableBCons += “<td width=’1%’ align=’right’><img src='”+BottomRight+”‘ alt=” /></td>”
TableBCons += “</tr>”
TableBCons += “</table>”
tDiv.innerHTML = TableTCons
tDiv.className = “”
tDiv.align = “”
CurrentHTML = rDiv.innerHTML.replace(/</div>/gi,””)
CurrentHTML = “</div>” + CurrentHTML + TableBCons
rDiv.innerHTML = CurrentHTML
rDiv.className = “”
}
for(d=0;d<Div.length;d++){
if(Div[d].className == “tableborder” && Div[d].getElementsByTagName(‘div’)[0]){
CheckDiv(Div[d])
}
}
Here’s the [URL=http://s11.invisionfree.com/hybrix/index.php]Board with code in use
Problem: The text on the maintitle isn’t centered. What would I add and where in order to make it centered?
Also, I have another problem; it would be great if you could answer this one as well. The advanced category grads only appear on the index page. How would I make it so that it appears on every page?
Thanks for any help. ?