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

Grid from HTML Table: text-align issue

2 Answers 241 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 2
Iron
John asked on 11 Aug 2016, 10:10 PM

Hi,

I'm creating a Kendo Grid from an existing HTML table. Everything works exactly as I need and expected...with one exception. Text alignment.

My table has a few columns with numeric values and I need these right aligned.

I thought it would be as simple as defining a col like this: <col style="text-align:right;" /> But that doesn't work. Oddly, this works: <col style="width:20px;" />

So, I next tried to format the alignment in the <thead> section, but I couldn't find a solution there.

<th data-field="Total" data-type="number" data-template="#= kendo.toString(Total , 'n0')#">Total</th>

 

I know I could write a template that is applied on a row by row basis, but I don't want to do that. We have a large existing website with lot's of tables and would like to use Kendo UI to replace them...but with minimal dev time.

 

Any ideas? Cheers

2 Answers, 1 is accepted

Sort by
0
Accepted
Iliana Dyankova
Telerik team
answered on 15 Aug 2016, 01:02 PM
Hi John,

The easiest way to achieve this is by using CSS :nth-child selectors. For your convenience here is a basic example.

Regards,
Iliana Nikolova
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
John
Top achievements
Rank 2
Iron
answered on 18 Aug 2016, 03:08 AM
Perfect :) Thanks for the solution. Worked like a charm.
Tags
Grid
Asked by
John
Top achievements
Rank 2
Iron
Answers by
Iliana Dyankova
Telerik team
John
Top achievements
Rank 2
Iron
Share this question
or