Html table notes

来源:互联网 发布:中国教育现状知乎 编辑:程序博客网 时间:2024/06/07 01:29
tables:
<table> tag:
rows <tr> each row is devided into data cells(with <td>tag). td stands for "table data", and holds the content of a data cell. A <td> can contain text, links, images, lists, forms, other tables, etc.
<table border="1">
---if you don't specify border, the table will be displayed without borders. default no border.
---Another attribute is that we use header.
table must have the header in the first line. So we need to add the header to the table. The tag is <th> just remeber.
---Also about the header: if you need the vertical headers, so you should just list the <th>and<td>. Horizontal headers, list them in another way.
---Table caption
ex:<table border="1">
   <caption>student info</caption>
   <...
---Ok, when you just operate an table, you must remeber the row <tr>, then the header <th>, and then the data <td>.alway!!! Of course, you can't forget to add <caption> following <table>
---We can also set the cellpadding.
Use this tag:
<table border="1" cellpadding="10">
----------------------------------------------------------
Ok, the last thing is to distinguish the <cellpadding> or <cellspacing>
One is how to use cellpadding to create more white space between the cell content and its borders.

Another is how to use cellspacing to increase the distance between the cells.

As to table color, we can use another way to do it.

<colgroup>tag.


-------------------------------------------------------------------------------------

Other tags: thead, tfoot, tbody

原创粉丝点击