Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to write the code for html to create a table?

2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how to write the code for creating a form in html". In daily operation, I believe many people have doubts about how to write the code for creating forms in html. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts about how to write the code for creating forms in html. Next, please follow the editor to study!

Html method to create a table: first use the "" tag to define the table frame; then use one or more "" tags to define rows in the table, and one or more "" tags to define cells; finally, in the td tag pair, fill in the table data (cell contents), the data can be text, pictures and other information.

The operating environment of this tutorial: windows7 system, HTML5 version, Dell G3 computer.

Tables are defined by tags.

Each table has several rows (defined by tags), and each row is divided into cells (defined by tags).

The letter td refers to tabular data (table data), that is, the contents of data cells. Data cells can contain text, pictures, lists, paragraphs, forms, horizontal lines, tables, and so on.

The border attribute specifies whether there is a border, does not write the border attribute or assigns a value of 0, and the table created will have no border; the size of the assignment determines the thickness of the border.

The th property sets the header. If the header is not specifically set, the header will be displayed in the same format as the content.

The following is a step-by-step introduction through code examples:

1. Write two simple tables without borders below.

The first form is name sex Zhang Sannu, the second form is name sex Zhang Sannu.

Effect:

2. Write a table with a border (the assignment of border determines the thickness of the border)

Set the title to the table, use.

If there is an empty value in the table, insert a space placeholder in this cell to keep the cell intact.

The third form, personnel information table, namesex, Zhang Sannu, unknown

Effect:

3. Set up a table that spans columns horizontally and rows longitudinally

A cell spans two columns and is set using colspan= "2". The numbers represent the columns that span.

Name score Zhang Dan 98 56 87

Effect:

A cell spans two rows and is set using rowspan= "2". The numbers represent the rows that span.

Name score Zhang Dan 98 56 87

Effect:

4. The tags of HTML can be nested at will.

4.1 nesting lists in cells

Fruit, banana, grape, tomato included in the room

Effect:

4.2 nesting cells in a cell

What I have to do.

/ /-A PPT meeting on Monday to write a report / /-A complete cell in the middle

Effect:

5. Change the table style

5.1 Cell style-cell margin to ensure the distance between the content and the border

/ /-use cellpadding to set cell margins

What I have to do.

/ /-use cellpadding to set cell margins to do PPT meetings on Monday to write reports

Effect:

5.2 one of the cell styles-add a background color or picture to the table (color bgcolor; picture background)

What I have to do.

Have a PPT meeting on Monday and write a report.

Effect:

5.3 set a separate background for a cell

What I have to do.

Have a PPT meeting on Monday and write a report.

Effect:

5.4 arrange the contents in the table-make the table look better (align)

The name of the meter Ua (V) Ub (V) Uc (V) 2018-6-19 0000 Uc 00232.2239.0231.82018-6-1905V 00232.6233.2234.32018-6-19 1000232.6232.2234.6

Effect:

At this point, the study of "how to write the code for creating a table in html" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report