2014-5-12 Qing Review Summary
① What is the meaning of the table?
表格应该用来展现那些适合表格化显示的信息,比如数据的显示,统计或者二维报表之类的信息,而不是作为一种而已的工作 |
② What are the elements of the table?
表格元素:table thead tbody tfoot caption tr th td .... 较常用 |
③ What should you pay attention to when using tables?
2) The content in the table must be written in tr or td cells, otherwise the content will run outside the table and cannot be included, for example:
4) The table element can only contain caption, colgroup, col, thead, tbody, tfoot, and cannot directly contain tr or any other element |
块元素: h div p title ol ul dl dt dd fieldset form … 1. 默认占据一整行, 块包含行/块元素 2. 设置宽高有效 3.margin和padding设置有效 4. 转换成行元素display:inline 行元素: a span i em strong b 1. 不会占据整行 行只能包含行元素,不能包含块元素 2. 设置宽高无效 3. 纵向margin的设置是无效的 4. 转换成块元素:display:block |
Advantages: Table layout is easy to use, can form complex changes, is simple and fast, more "rigorous" in performance, and can be used well in different browsers Compatible Disadvantages: Not conducive to maintenance, lots of code, redundant, if the table exceeds 3 layers, the search engine will no longer crawl it. If your website needs layout changes, the layout of the table will be reset. Design, coupled with table rows and columns, etc., the proportion of page changes will be slightly larger, which will affect your preparation of some ranking and search foundations in the early stage. ① Bloated code ② Page rendering performance issues ③ Not conducive to search engine optimization ④ Poor accessibility ⑤ Insufficient semantics ⑥ Setting the basic attributes of the table (merging rows and columns)? Column merging: colspan means merging columns, and "3" refers to three columns. colspan="3" means to merge three columns into one column. In other words, it is to merge three vertical cells into one cell. Row merging: rowspan code to merge rows, the "7" here means merging 7 rows. Code practice: open |
Advantages: Convenient for maintenance and changes, conducive to SEO crawling, (note the comparison of table layouts), reasonable structural nesting, separation of structural styles, reducing web page loading time, Page rendering performance is higher than table Disadvantages: ① High development technology As we all know, div css must be compatible with various browsers, which increases the difficulty of div css development. ② Long development time. Compared with table layout, div css layout takes much longer than table layout. In addition, considering browser compatibility issues, testing between various browsers is also a time-consuming matter. ③ The development cost is high. As mentioned in the above two points, high technology and long time determine its cost. |
Block elements: h div p title ol ul dl dt dd fieldset form … 1. By default, it occupies a whole row, and the block contains row/block elements 2. Setting width and height is valid 3. Margin and padding settings are valid 4. Convert to row element display: inline Row element: a span i em strong b 1. Will not occupy the entire row Can only contain row elements, not block elements 2. Setting width and height is invalid 3. Setting vertical margin is invalid 4. Convert to block element: display: block | tr>
Nesting rules of tags
2. ins and del (inline elements) can contain block elements or inline elements, and any other inline elements are not allowed to contain block elements 3. p, h1-h6 can be directly included Contains inline elements and text information, but block elements are not allowed 4. The dl element is only allowed to contain dt and dd, while dt cannot contain block elements, only inline elements are allowed, and dd can contain any element 5. Form elements cannot directly contain input elements. The reason is that the input element is an inline element, and the form element can only contain block elements 6. The table element can only contain caption, colgroup, col, thead, tbody, tfoot, and cannot directly contain tr or any other element |