This is a migrated thread and some comments may be shown as answers.

"Initialization from table" grid in the style (class, align ..) apply

1 Answer 64 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jong Woo
Top achievements
Rank 1
Jong Woo asked on 17 Jan 2014, 04:21 AM
            <table id="grid">
                <colgroup>
                    <col />
                    <col />
                    <col style="width:110px" />
                    <col style="width:120px" />
                    <col style="width:130px" />
                </colgroup>
                <thead>
                    <tr>
                        <th data-field="make" style="text-align:center;">Car Make</th>
                        <th data-field="model">Car Model</th>
                        <th data-field="year">Year</th>
                        <th data-field="category">Category</th>
                        <th data-field="airconditioner">Air Conditioner</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="table-cell" style="text-align: center; font-size: 14px">Volvo</td>
                        <td>S60</td>
                        <td>2010</td>
                        <td>Saloon</td>
                        <td>Yes</td>
                    </tr>
                    <tr>
                        <td>Audi</td>
                        <td>A4</td>
                        <td>2002</td>
                        <td>Saloon</td>
                        <td>Yes</td>
                    </tr>
                </tbody>
            </table>            
            <script>
                $(document).ready(function() {
                    $("#grid").kendoGrid({
                        sortable: true
                    });
                });
            </script>

 <td class="table-cell" style="text-align: center; font-size: 14px">  application of the central alignment and class, what should I do?

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 17 Jan 2014, 01:16 PM
Hello Jong Woo,

In case you would like to center content of all Grid cells you could use the following CSS rule:   
#grid td{ 
  text-align: center;
  font-size: 14px;
}

If you want to center only the first column I would suggest the following:   
#grid td:nth-child(1){ 
  text-align: center;
  font-size: 14px;
}
I am afraid however, that adding the td classes to the Grid's cells is currently not supported out of the box.

Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Jong Woo
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or