joecen 发表于 2009-4-22 17:16:12

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

如题。
我要实现的表格的head和表格的body的td数量不一致,请问如何实现td的colspans功能?

joecen 发表于 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.

Hex 发表于 2009-4-22 17:41:50

我觉得直接写 HTML 比用 Table 类好的多。

joecen 发表于 2009-4-22 18:50:14

之前的表格都用的table类,现在又搞个直接写html的话,觉得有点怪怪的。

paleapple 发表于 2009-4-22 22:38:42

<table>
<tr>
<td>xxx</td>
<td>yyy</td>
</tr>
<tr>
<td colspan=2>zzz</td>
</tr>

Hex 发表于 2009-4-22 23:33:28

晕倒,直接写 HTML 竟然成了“怪怪”的了。。。。。。。。

joecen 发表于 2009-4-23 07:55:33

晕倒,直接写 HTML 竟然成了“怪怪”的了。。。。。。。。
Hex 发表于 2009-4-22 23:33 http://codeigniter.org.cn/forums/images/common/back.gif

我的意思是,有些用类有些直接写html,不是很统一,感觉有点怪。

advancejar 发表于 2010-1-28 10:17:33

我也想知道。
页: [1]
查看完整版本: 请问使用html 表格类如何实现colspans的功能?