Iv. Forms (table)
1. Basic forms of forms
The table starts with <table>, </table> ends, and the contents of the table are defined by <tr>,<th> and <td>.
L <tr> a row of the table, the number of rows on the table is how many <tr>;
L <th> The number of columns in the table and the names of the corresponding columns (column headings), How many columns there are <th>;
L <td> fill in the form of <tr> and <th>;
L Border property: Indicates whether a border is used.
Below is a table with table lines.
Example: A table with column headings:
<table border>
<TR>
<TH> name </TH><TH> Sex </TH><TH> Graduate school </TH>
<TR><TD> Zhang Fei </TD><TD> male </TD><TD> self-taught ></TD>
</TABLE>
2. Table with Banner
a . table with horizontal banner
<th Colspan=#> # represents the number of columns (column) occupied by the banner.
Example: A table that spans multiple columns
<table border= "1" width= "100%" cellspacing= "1" >
<tr>
<TD colspan= "3" ><b><font color= "Red" > Three heroes </font> </td>
</tr>
<tr>
<td> name </td>
<td> Sex </td>
<td> Graduate School </td>
</tr>
<tr>
<td> Zhang Fei </td>
<td> Men </td>
<td> self-taught </td>
</tr>
<tr>
<td> Liu Bei </td>
<td> Men </td>
<td> Royal Academy </td>
</tr>
<tr>
<td> Guan Yu </td>
<td> Men </td>
<td> Ominous </td>
</tr>
</table>
B . a table with vertical banner
<th rowspan=#> # Indicates the number of rows that the banner occupies, which should be less than the number of rows in the table.
There is a vertical banner table, each line must be </tr> explicitly given a horizontal column end, which is different from the basic form of the table.
<table border>
<tr><th rowspan=3> Morning menu</th><th>food</th> <td>A</td> </tr>
<tr><th>Drink</th> <td>B</td> </tr>
<tr><th>Sweet</th> <td>C</td> </tr>
</table>
2. table size, border width, table spacing
A . Size of Table
width=#, table width, height=#, table height, # is an integer in pixels
Example: Table Size setting:
<table Border width=170 height=100>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
B , Border width
border=#, # is the width value, in pixels.
Example: Border Size setting:
<table border=10>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
C , the spacing of table cells
cellspacing=#, # is a unit of pixels,
Example: The table spacing is defined as 10 pixels, and it looks like a table with a thick line.
Cases:
<table Border cellspacing=10>
<tr><th>Food</th><th>Drink</th> <th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
3. output of the text in the table
a , the distance between the text and the table frame
cellpadding=#. # The Unit is pixel
Example: Leave the table's contents and table boxes 10 pixels away from each other.
<table Border cellpadding=10>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
B , the position of the text (left and right) output
Text (left and right) output position when the width of a table cell is greater than the width of the text
align=#, # for
Left justified
Center Center
Right Justify
The Align property can be decorated with <tr>,<th> and <td> linked bookmarks.
Cases:
<table Border width=300>
<tr>
<th align=left>food</th><th>drink</th><th>sweet</th>
<tr>
<TD align=left>a</td><td align=center>b</td><td align=right> C</td>
</table>
Figure:
C , the position of the text (up/down) output
When the table height is greater than the height of the text, use valign=# to indicate the position of the text. For
Top Upper Alignment
Middle, center
Bottom, bottom align
Baseline text baselines aligned to table centerline
It is especially important to note the baseline alignment, where the text appears above the grid instead of the lower half of the phase image.
Valign can be modified <tr>,<th>,<td>.
Cases:
<table Border height=100>
<tr>
<th>Food</th><th>Drink</th>
<th>Sweet</th><th>Other</th>
<tr>
<TD valign=top>a</td>
<TD valign=middle>b</td>
<TD valign=bottom>c</td>
<TD valign=baseline>d</td>
</table>
4. Table Color
The color of the table is specified with bgcolor=#. # is 16 binary 6 digits, the format is RRGGBB, respectively, the red, green, blue three color components. Or a well-defined color name, see text color.
<table border>
<tr><th bgcolor=000000>
<font color=ffffff>food</font></th>
<th bgcolor=white>drink</th>
<tr>
<TD bgcolor=olive>a</td><td>b</td>
</table>
Note 000000 is black, FFFFFF white, olive olive green
Hypertext Link (This part is not, please test yourself)
Hypertext links are one of the most appealing features of HTML. Use hypertext link pointers to make sequential files somewhat
The ability of random access, more in line with the human way of thinking.
In this section, we will study the following knowledge:
Create a hypertext link inside a file
Create hypertext links to other internal files and external files
1. Uniform Resource Locator URL
The Uniform Resource Locator URL (Uniform Resource Locator) is an extension of the file name.
URL composition: protocol://machine.name[:P ort]/directory/filename
Protocol: The protocol used to access the resource, the method that accesses the resource, which can be an HTTP Hypertext Transfer Protocol,
It can also be an FTP file Transfer protocol, and other protocols such as file, news, and so on.
Machine.name: Access to the IP address or domain name of the resource host, usually in the form of a character domain name, such as www.rwstar.com. 。
[:P ORT] The port number used by this resource host (server). In general, the default is 80,
Write only if the port number used by the server is not the default port number.
Directory/filename: Is the path and file name on the host (server) on which the resource resides.
A typical URL is: http://www.xfocus.com/index.php. It represents the home page file on the security Focus Web server.
2. A Mark
Links are mainly implemented by A tag. A tag can support more attributes, the most important of which is the Href and the Name attribute.
L HREF attribute (abbreviation for hypertext Reference)
If the A tag contains an Href attribute, the text between the start and end tags of the label becomes hypertext (hypertext)
It is the name of the resource to be accessed (linked), and in the browser, the hypertext is usually displayed in a different color with an underlined character.
Basic format <a Href = "Url" > Name of the resource to access (link) </a>
(note quotation marks)
The Uniform Resource Locator (URL) in the href attribute is the path to the resource to be accessed, and the subsequent "string" in the HTML file acts as
The role of the pointer. When you click the string with the mouse, the browser will send a request for the page through the network, along the path specified by the URL.
and the page that executes the return is interpreted.
Example: <a href= "http://www.163.com" > click to enter NetEase </a>
Click "Click to enter NetEase", you can enter the UESTC People style website homepage. In this example, the pointer is
"Click to enter NetEase" these few characters.
Six Text Movement <marquee>
Basic format
<marquee Move Properties > move text </marquee>
Settings for Text Movement properties:
L Move Direction: <direction=#> # for Left, right
Cases:
<marquee direction=left> Moving text, move from right to left! </marquee> <P>
<marquee direction=right> Moving text, move from left to right! </marquee>
L Mode of movement: <bihavior=#> #=scroll, Slide, alternate
Cases:
<marquee behavior=scroll> Move the text, walk around a circle! </marquee> <P>
<marquee behavior=slide> Move the text, move it once to stop! </marquee> <P>
<marquee behavior=alternate> move text, move back and forth! </marquee>
L Cycle times: <loop=#> #= times; If not specified, the loop is not
Cases:
<marquee loop=3 width=50% behavior=scroll> move text, move 3 times </marquee>
Note: Width= #, starting at the specified position of the browser window width, can be a percentage of the pixel or window width.
L Movement Speed: <scrollamount=#> # For each number of pixels to move, the larger the faster the movement.
Cases:
<marquee scrollamount=20> moving text, moving faster </marquee>
L Delay <scrolldelay=#> # is the time, the number of milliseconds, the longer the value, the longer the interval
Cases:
<marquee scrolldelay=1000 scrollamount=500> Text intermittent movement </marquee>
Cases:
<font size=6>
<marquee align=top width=400> Moving text, alignment </marquee>
</Font>
L Background <bgcolor=#>
#: RRGGBB 16 Digital, or pre-defined color, such as red,green,yellow, etc.
Cases:
<marquee bgcolor=green>< Mobile text, green background </marquee>
(This section cannot be used as an example of a picture, except with a screen recorder software)
HTML QuickStart 3