Master checkbox not moving into center.

Hi,

I am using the gridbox for the below code but the master checkbox not moving into center.

mygrid = new dhtmlXGridObject(‘gridbox’);
mygrid.setImagePath("…/images/dhtmlx/grid/");
mygrid.setHeader(“Seleccion, Number”);
mygrid.attachHeader("#master_checkbox,#text_filter");
mygrid.setInitWidths(“66,*”);
mygrid.setColAlign(“center, center”);
mygrid.setColTypes(“ch,ro”);
mygrid.enableMultiselect(true);
mygrid.init();
mygrid.submitOnlyChanged(false);
mygrid.setSkin(“dhx_skyblue”);
mygrid.loadXML("…/common/grid_08_filtering.xml");

Please advise on what could be missing or wrong here as I tried many variations but nothing seems to work.

Many Thanks in Advance

Ramesh

You may try to add a second parameter of attachHeader method:

mygrid.attachHeader("#master_checkbox,#text_filter",["text-align: center",""]);

I know this is an old thread but I am having the same issue. I am using attachHeader method and have a #master_checkbox in column 0. It is automatically padded/aligned to the right. I have tried the advise you gave here and it does not work. It is applied to the td element but, the checkbox is contained in a div inside the td with a class of “hdrcell” that has the padding-left:10px attribute.

I also tried the example listed here but this apparently only applies to the setHeader method.

I have also tried adjusting the margin and padding in the td cell but nothing I’ve done seems to work.

My code:

appGrid.setHeader("✓,Employee Name,Employee Title,Department,Telephone Number,GUID"); appGrid.attachHeader("#master_checkbox,#text_filter,#text_filter,#select_filter, , ",["text-align:left;","","","","",""]); appGrid.setInitWidths("30,*,*,*,*,*"); appGrid.setColTypes("ch,ro,ro,ro,ro,ro");

I also tried this:

<div id='masterCheckbox' style='width:100%;text-align:center;'>#master_checkbox</div>

but it simply displays the text #master_checkbox instead of the actual checkbox.

I tried this:

<div id='masterCheckbox' style='width:100%;text-align:center;'><input type='checkbox'></div>

it produces a checkbox but, it is no longer a “master_checkbox” in that it does not control the checkboxes in the column. It is also still not centered due to the 10px padding-left in hdrcell.

the solution with the style attribute of the attachHeader method should work correctly.
If the problem still occurs for you could you please, provide with a complete demo or a demo link, where the problem can be reconstructed locally.

Also, please, make sure that you have not redefined the global css styles on your page.