Alignment of grid from HTML


When converting HTML tables to a grid, how can the grid be center aligned. I have an existing table that is placed in the center of the page. When converting it into dhtmlx grid, the table gets aligned to the left inspite of defining the table with align=“center”. Is there any property that can be set to make the table get center aligned?


When you initialize grid from HTML table, first row is recognized as grid header. You can use “align” parameter of “td” element at first cell to set column alignment. Please find more information here … _from_html

I have the columns aligned properly. I want the table also to be center aligned in the page. I have specified <table align=“center”…>. But still, the table is aligned to the left.

You should use “align” attribute of the “td” element at first row

My code is

            		<td type="ro" sort="str" align="center">Column 1</td>
            		<td type="ro" sort="str" align="left">Column 2</td>
            		<td type="ro" sort="str" align="left">Column 3</td>
            		<td type="ro" sort="str" align="left">Column 4</td>
            		<td type="ro" sort="str" align="center">Column 5</td>
            		<td type="ro" sort="str" align="left">Column 6</td>
            		<td type="ro" sort="str" align="left">Column 7</td>
            		<td type="ron" sort="int" format="0,000" align="right">Column 8</td>
            		<td type="ron" sort="int" format="$0,000.00" align="right">Column 9</td>

The columns are getting aligned as it should. IT is the whole grid from the table which is aligned to the left. I want the grid also to be in the center.

Please let me know if I am setting something wrongly.


Try to use following approach: