To solve this problem to understand a concept is the box, the box is like the layout of XML, the whole page as a large box <body ></body> What you have to do is put the first level of layout on the first floor, The entire page is then split into each control so that each level two control can be viewed as a box, so that it is placed until the control can no longer be dropped so that it is clear how to center a control.
So now it's time to provide solutions
The center is supported by the parent control. If the parent control is wrap content, it's not to say how the child controls are centered, because the tinkering and layout of the control is done inside the parent control, that is, the parent control must have a certain size, so the control has a certain operating space, the following code is <table>
Table {
width:700px;
}
TR {
text-align:center;
}
Here only the CSS code, obviously this is consistent with the above, in order to fit the screen, do not recommend the use of Pixel direct operation, but use the next relative value to operate, the following is the modified code
<table width= "100%" border= "1" >
<tr align= "center" >
<td> Hello </td>
<td> Hello </td>
</tr>
<tr>
<td> Hello </td>
</tr>
<tr> <td> Hello </td>
</tr>
<tr>
<td> Hello </td>
</tr>
</table>
Show results
Hello |
Hello |
Hello |
Hello |
Hello |