HTML has a lot of elements, and each of them is unique in its own way. The table is a very interesting, demanded and serious object. Thanks to it, you can not only provide information in a convenient form, but also build a whole site frame.
Previously, almost all webmasters used tables specifically for site layouts. Initially, tables were not invented for this. Therefore, to mark up the site you need to use the block div element.
If you do not want to always be a beginner, get used to doing everything right right away. This is very important in the HTML language. Only normal information (text, links, lists, images, etc.) should be placed in the table, and not the entire site.
How to make an HTML table?
- , . , . . , , . .
"", . , - " ", " " .
2 2.
<table width="100%" border="1">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<table> </table> . <tr> </tr> - . , <td> </td>.
: . .
, Word Excel, .
?
Colspan Rowspan. Span "" "". - / /.
, . HTML .
3 colspan="3". . , / . . , , .
5 2 4, 2 colspan="3".
9 . . .
. .
, HTML. .
.
, . , .
. , .
Align , valign - . .
align valign . , , .
<td> <tr>, <th>. <td>, . <th> .
?
HTML, . head <link rel = “stylesheet” href = “style.css” type = “text/css”> ( head).
<head>
...
<style type="text/css">
table {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #000000;
}
.my_class
{
color: #666666;
}
</style>
...
</head>
table, . . , , , , .
<table class="my_class">
, table, .
<table class="style_table" width="100%" border="1">
<tr class="style_row1">
<td class="style_td1"> </td>
<td class="style_td2"> </td>
</tr>
<tr class="style_row2">
<td> </td>
<td> </td>
</tr>
</table>
- , . , , . .
What attributes can be written in style classes? There are so many attributes that apply specifically to tables. Consider the most basic ones that are useful to you.
align | Horizontal alignment |
valign | Vertical alignment |
background | Background image in cell / table |
bgcolor | Cell background color |
bordercolor | Table / cell frame color |
height | Cell height |
nowrap | Prevent text wrapping in a line. |
width | Cell / Table Width |
As you can see, you can use HTML in a table with a huge number of "tools".
Beautiful created using HTML tables. Examples
Thanks to the styles you can create various beautiful tables. It all depends on what and how you like.
It’s like cooking. The ingredients are the same, but there are a lot of recipes.As you can see, if you use HTML tags, the table can be transformed beyond recognition. The boundaries of possibilities are determined by your imagination.