Centering a Layouts header text

Folks, I have read in the forum that you may center the text of a layout’s header by using css. I have a 1C layout in which I am trying to center the text, without success. Here is the code:

layout = new dhtmlXLayoutObject(document.body, “1C”);
layout.cells(‘a’).setText(‘

Text to Center
’);

Any help would be much appreciated.

Thanks,

Daryl

Approach is the next:

layout = new dhtmlXLayoutObject(document.body, "1C"); layout.cells('a').setText('<div id="div_id">Text to Center</div>'); document.getElementById("div_id").style.width = layout.cells("a").offsetWidth-20+"px"; document.getElementById("div_id").style.textAlign = 'center'; layout.attachEvent("onResizeFinish", function(){ document.getElementById("div_id").style.width = layout.cells("a").offsetWidth-20+"px"; document.getElementById("div_id").style.textAlign = 'center'; });