Table is an awkward tag in XHTML. This section is just for understanding
Before the popularity of CSS, table was widely used for positioning. In XHTML, table is not recommended for positioning. W3C hopes that CSS can replace <table> in positioning. However, in fact, because the use of CSS layout often requires a lot of handwritten code (common web design software such as Dreamweaver can not perfectly support the display of DIV), <table> is still used by many websites for home page layout. For example, Google’s more products page uses table to locate. However, I personally recommend that you start using CSS to locate web pages, because this is the direction of web development. Of course, replacing table with CSS in the early stage may cause you a lot of trouble.
In XHTML, the tag used to create a table is <table>. When writing code, we should first use the <tr> tag to divide the table into rows, and then use the <td> tag to divide each row into cells. It is very difficult and inefficient to create a table with completely handwritten code. Making a table in a web page making software is as simple as word. You only need to select simple attributes such as rows and columns. However, we may encounter the possibility that the automatically generated table does not meet the requirements and needs to be adjusted in the code mode. Therefore, we still need to understand the specific writing of XHTML table tags.
The <table> tag can have a border attribute. If you do not set the value of the border property, the browser will not display the border of the table by default.
Let’s create a label with four rows and two columns. The code is as follows:
<table border=”1″>
<tr>
<td>A grid</td>
<td>A grid</td>
</tr>
<tr>
<td>A grid</td>
<td>A grid</td>
</tr>
<tr>
<td>A grid</td>
<td>A grid</td>
</tr>
<tr>
<td>A grid</td>
<td>A grid</td>
</tr>
</table>
The display results are as follows: note the above code. There are four pairs of <tr>, corresponding to the following four lines. There are two <td> cells in each <tr> (row). So it becomes a table with 4 rows and 2 columns.
A grid
Such a table is sufficient to list information such as data, but the table used to locate is usually more complex. Again, we don’t recommend using table to locate, so here we just briefly introduce <table>.
Recommended Today
The idea compilation project always prompts that the package cannot be found. Delete the dependency in ieda, update maven, and re import. Ensure that the local warehouse location is the location of the project dependency reference
The idea compilation project always prompts that the package cannot be found. Delete the dependency in ieda, update maven, and re import. Ensure that the local warehouse location is the location of the project dependency reference https://blog.csdn.net/qq_36698385/article/details/119423197 Problem description In idea, the code does not display any error prompt, but when compiling the code, it […]
- Vue project configuration internationalization based on typescript
- You ask me and answer: the difference between XML and HTML
- Understand Ajax in one article, and attach Ajax interview questions
- Vue-cli3.0 daily optimization
- Complete HTML of upload form with picture preview function
- Quick sort (JS Implementation)
- HTML table markup tutorial (10): cell margin attribute cellpadding
- HTML table markup tutorial (11): align attribute horizontally
- 3-javascript (II)
- HTML table markup tutorial (12): border style attribute frame