views:

39

answers:

2

I want to get the Name and Description in the center of the columns.. I tried a lot but no luck... I kno this is silly doubt but i am stuck...

here is the .aspx code

<!-- <table cellpadding="3" cellspacing="4" align="center" 
    style="width: 100%; height: 60%">
    <tr>
        <td bgcolor="#4F81BD" style="color: #FFFFFF" width="50%" align="center" >
            Name</td>
        <td bgcolor="#4F81BD" style="color: #FFFFFF" width="50%">
            Description</td>
    </tr>

as you can see i have also tried align.. it still does not work

+2  A: 

Try using the text-align CSS property:

<table cellpadding="3" cellspacing="4" align="center" style="width: 100%; height: 60%">
<tr>
    <td bgcolor="#4F81BD" style="color: #FFFFFF; width:50%; text-align:center">
        Name</td>
    <td bgcolor="#4F81BD" style="color: #FFFFFF; width:50%; text-align:50%">
        Description</td>
</tr>
SLaks
thanks a lot buddy..
A: 

In what way is it not working? What you have done should be displaying 'Name' centered, if not then it's possibly being affected by your css and the inline style approach SLaks has shown will fix it.

If your problem is that you want all text in those columns to be centered then try.

<table>
<col align="center" />
<col align="center" />
<tr>
Martin