1、HTML表格HTML表格表格由来定义。每个表格有若干行每行被分割为若干单元格td(table data)即数据单元格的内容,可以包含文字、文本、图片、列表、段落、表单、水平线、表格等等row 1,cell 1row 1,cell 2row 2,cell 1row 2,cell 2以上表格的源代码如下:html view plaincopyprint?1. 2. 3. row 1,cell 1 4. row 1,cell 2 5. 6. 7. row 2,cell 1 8. row 2,cell 2 9. 10. row 1,cell 1row 1,cell 2row 2,cell 1row 2
2、,cell 2表格的表头HeadingAnother Headingrow 1, cell 1row 1, cell 2row 2, cell 1row 2, cell 2源代码如下html view plaincopyprint?1. 2. 3. Heading 4. Another Heading 5. 6. 7. row 1, cell 1 8. row 1, cell 2 9. 10. 11. row 2, cell 1 12. row 2, cell 2 13. 14. HeadingAnother Headingrow 1, cell 1row 1, cell 2row 2, ce
3、ll 1row 2, cell 2表格中若有空单元格,可在空单元格中加一个空格占位符: 其它实例1. 带有标题的表格我的标题100200300400500600html view plaincopyprint?1. 2. 3. The table has a caption and thick frame: 4. 5. My caption 6. 7. 100 8. 200 9. 300 10. 11. 12. 400 13. 500 14. 600 15. 16. 17. 18. The table has a caption and thick frame:My caption
4、1002003004005006002. 跨行或跨列的表格单元格横跨两列的单元格:NameTelBill Gates555 77 854555 77 855横跨两行的单元格:NameBill GatesTel555 77 854html view plaincopyprint?1. 横跨两列的单元格: 2. 3. Name 4. Tel 5. 6. 7. Bill Gates 8. 555 77 854 9. 555 77 855 10. 11. 12. 横跨两行的单元格 13. 14. 15. Name 16. Bill Gates 17. 18. 19. Tel 20. 555 77 85
5、4 21. 22. 横跨两列的单元格:NameTelBill Gates555 77 854555 77 855横跨两行的单元格NameBill GatesTel555 77 8543. 表格内的标签This is a paragraph.This is another paragraph.This unit contains a table ABCDThis unit contains a list: Apple Banana PineappleHelloCode:html view plaincopyprint?1. 2. 3. 4. This is a paragraph. 5. Thi
6、s is another paragraph. 6. 7. This unit contains a table 8. 9. 10. A 11. B 12. 13. 14. C 15. D 16. 17. 18. 19. 20. 21. This unit contains a list: 22. 23. Apple 24. Banana 25. Pineapple 26. 27. 28. Hello 29. 30. This is a paragraph. This is another paragraph.This unit contains a table A B C D This un
7、it contains a list: Apple Banana Pineapple Hello4. 单元格边距No cellpadding:FirstRowSecondRowWith cellpadding:FirstRowSecondRowhtml view plaincopyprint?1. No cellpadding: 2. 3. 4. First 5. Row 6. 7. 8. Second 9. Row 10. 11. 12. 13. 14. With cellpadding: 15. 16. 17. First 18. Row 19. 20. 21. Second 22. Ro
8、w 23. 24. No cellpadding: First Row Second RowWith cellpadding: First Row Second Row5. 单元间隔距(cellspacing)With cellspacing:FirstRowSecondRowhtml view plaincopyprint?1. With cellspacing: 2. 3. 4. First 5. Row 6. 7. 8. Second 9. Row 10. 11. With cellspacing: First Row Second Row6. 向表格添加背景颜色或图像 7.向表格单元格
9、添加背景颜色或图像html view plaincopyprint?1. 2. 3. First 4. Row 5. 6. 7. Second 8. Row 9. 10. FirstRowSecondRow8. 在表格单元中排列内容Consumed item.JanuaryFebruaryClothes$241.10$50.20Makeup$30.00$44.45Food$730.40$650.00Total$1001.50$744.65html view plaincopyprint?1. 2. 3. Consumed item. 4. January 5. February 6. 7. 8
10、. Clothes 9. $241.10 10. $50.20 11. 12. 13. Makeup 14. $30.00 15. $44.45 16. 17. 18. Food 19. $730.40 20. $650.00 21. 22. 23. Total 24. $1001.50 25. $744.65 26. 27. Consumed item.JanuaryFebruaryClothes$241.10$50.20Makeup$30.00$44.45Food$730.40$650.00Total$1001.50$744.659. Frame属性Comment:frame 属性无法在I
11、nternet Explore中正确的显示Table with frame=box:MonthSavingsJanuary$100Table with frame=above:MonthSavingsJanuary$100Table with frame=below:MonthSavingsJanuary$100Table with frame=hsides:MonthSavingsJanuary$100Table with frame=vsides:MonthSavingsJanuary$100html view plaincopyprint?1. Table with frame=below: 2. 3. 4. Month 5. Savings 6. 7. 8. January 9. $100 10. 11.
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1