用户
 找回密码
 入住 CI 中国社区
搜索
查看: 4565|回复: 7
收起左侧

请问使用html 表格类如何实现colspans的功能?

[复制链接]
发表于 2009-4-22 17:16:12 | 显示全部楼层 |阅读模式
如题。
我要实现的表格的head和表格的body的td数量不一致,请问如何实现td的colspans功能?
 楼主| 发表于 2009-4-22 17:24:16 | 显示全部楼层
如果我没看错的话,champs说用现在的class是可以做到:
http://codeigniter.com/forums/viewthread/46580/
Not that anybody wants my opinion, but the table class is only suitable for quick and dirty dumps of tabular data, much like scaffolding is for data entry.  There’s a fine line betweeen being all things to all people and nothing for everybody, and the existing functionality already inches pretty close to that.

Here’s what could be in the class:

* colspans, rowspans, or combination
* Setting cell/row/table attributes, i.e. class
* Proper use of THEAD, TBODY, and TFOOT
* Rotate the input array to make columns into rows, and vice versa
* etc.

By the time you’ve mastered these functions to get the table as fancy as you’d like it, you could have just written the table in a view—and as presentation logic, you probably should, anyway.
发表于 2009-4-22 17:41:50 | 显示全部楼层
我觉得直接写 HTML 比用 Table 类好的多。
 楼主| 发表于 2009-4-22 18:50:14 | 显示全部楼层
之前的表格都用的table类,现在又搞个直接写html的话,觉得有点怪怪的。
发表于 2009-4-22 22:38:42 | 显示全部楼层
<table>
<tr>
<td>xxx</td>
<td>yyy</td>
</tr>
<tr>
<td colspan=2>zzz</td>
</tr>
发表于 2009-4-22 23:33:28 | 显示全部楼层
晕倒,直接写 HTML 竟然成了“怪怪”的了。。。。。。。。
 楼主| 发表于 2009-4-23 07:55:33 | 显示全部楼层
晕倒,直接写 HTML 竟然成了“怪怪”的了。。。。。。。。
Hex 发表于 2009-4-22 23:33


我的意思是,有些用类有些直接写html,不是很统一,感觉有点怪。
发表于 2010-1-28 10:17:33 | 显示全部楼层
我也想知道。

本版积分规则