0

I have an .aspx file and i try to align the table to the center. But when i do this

<table style="text-align:center">

it does not work.

It shows the table always at the left side of the page.

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by greeny_1984
0

<table style="text-align:center">
This is to align the content/data inside the table
One way to achieve your requirement is to put your table inside a div and align the div to center. Here is a sample

<div style ="width:100%; height: 100%; text-align: center">
<table >
<thead>
<tr>
<td>Name</td>
<td>Roll NO</td>
<td>Class</td>
</tr>
</thead>


<tr>
<td>Alex</td>
<td>20901</td>
<td>10</td>
</tr>


<tr>
<td>Betty</td>
<td>20902</td>
<td>11</td>
</tr>

</table>
</div>

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.