Tabbar setSize in %


I am new to dhtmlx, trying to create tabbar and I am able to create it.

Also I am trying to use the API method “setSize” to set the width and height of the Tabbar,

It is working fine if we just give the px value as like setSize(“200”,“600”);

but I need to provide the width and height in “%” as like setSize(“50%”,“100%”) which is not seems to be working,

is it possible to provide the Tabbar size in %, please help me this.

Awaiting for Replies,


setSize doesn’t accept values in precent. You may set sizes for the tabbar container in percent:

tabbar=new dhtmlXTabBar(“a_tabbar”,“top”);

To resize tabbar when the window resized you may apply enableAutoReSize method:

If the sizes of the “a_tabbar” container are changed dynamically, you may call _setSizes() method after size change:

Thanks Alex,that worked for me.


This doesn’t work in Firefox when the doctype is xhtml and the tabbar is nested in a table.
It doesn’t show the tabbar.

some header row
content 1
content 2

It’s a pity that you cannot use % in setSize(), otherwise that would solve the problem.
It’s working fine when the doctype is html, but not when it’s xhtml.


check that tabbar container changes its size. As Tabbar is adjusted to size of its container. Please see the sample:


Hello Alexandra,

In the script that creates the tabbar, I already had the enableAutoReSize set to true.
It actualy is not only an issue in Firefox, but also in IE.
But only when the doctype is xhtml and the tabbar is nested in a table, like in my example.


Probably “a_tabbar” div doesn’t take desired size. Check that this container changes the size with browser window.