BigJim
BigJim

Reputation: 411

cell alignment in Grid

Hi I have a grid I'm trying to style. A skin was provided for me which contains:

#tblPageContent td
{
   padding:0px;
   margin:0px;
   vertical-align:top;
   text-align:left;
}

This is used to style other elements in the web application so I can't remove this.

The problem is this is styling my grid items to all be align left. I actually want them centered.

I tried to override this by adding a class to my grid and setting:

.myRadGridClass
{
   text-align="center;
}

and

#myRadGrid td
{
   text-align:center;
}

However this is not working right now.

Can someone please help me to get the grid cells centered without removing the skin css?

Upvotes: 2

Views: 954

Answers (1)

Hugo Migneron
Hugo Migneron

Reputation: 4907

You only need to be more specific than the rule that's already defined.

I imagine that the HTML code generated looks like this :

<table id="tblPageContent">
    <tr>
        <td class="myRadGridClass">Content of your cell</td>
    </tr>
</table>

If you go with the following css it should work :

#tblPageContent td.myRadGridClass
{
    text-align:center;
}

If the HTML code doesn't look like this, post a snippet and we'll be able to help you out.

Upvotes: 5

Related Questions