This article focuses on the central use of the table label for HTML tables, as well as how the Align property is used in table labels to help align the table alignment and the text in the table. Now let's take a look at this article.
First, let's look at the use of the table table's contents centered:
Let's first introduce a property, which is the Align property.
The Align property specifies how the table is aligned relative to the surrounding elements.
Usually, the wrapping occurs before and after the HTML table. The effect of other HTML elements around the table can be implemented by using the Align property.
In HTML4.01, the Align property of the BODY element is deprecated, and the align attribute of the BODY element is not supported in the Xhtml1.0strict DTD.
Please use CSS instead.
CSS Syntax:
<table style= "Float:right" >
The syntax for centering the Align property in the table table:
<table align= "center" >
Here are some common property values for the Align property:
Let's look at an example:
<table border= "1" align= "center" > <tr> <th>Month</th> <th>savings</ th> </tr> <tr> <td>January</td> <td align= "center" >$100</td > </tr> <tr> <td>February</td> <td>$80</td> </ Tr></table>
It is obvious in this code that I set the center alignment in the Table tab, which means that the table has been centered in the Web page, followed by the Align attribute in the TD tag, and the text in it is aligned, so the final display of the fresh fruit
, in the middle of the page is displayed, the middle of the TD tag I used the Align attribute to center, so the middle of the text is displayed in the middle of the civilian.
Let's move the text to the right to see:
<table border= "1" align= "center" > <tr> <th>Month</th> <th>savings</ th> </tr> <tr> <td>January</td> <td align= "center" >200</td > </tr> <tr> <td>February</td> <td align= "right" >180</td > </tr></table>
Now the following one TD changed to the right, to see the effect:
, the back of the 180 really to the right, this is the center of the HTML table tag usage, is also the use of the Align property in table. This is the end of this article, there are questions can be in the bottom of the message.