2013-03-03 66 views
1

我了解dart webui和<template>项目中的限制。dart webui中的TBODY模板

即:一个可以解决这个限制正是如此使用模板表:

<table> 
    <tbody iterate="row in rows"> 
    <tr iterate="cell in row"> 
    <td> {{cell}} </td> 
    </tr> 
    </tbody> 
</table> 

不过。一个应该如何使用模板时,该表应具有多发 TBODY部分(例如:http://jsfiddle.net/umRJr/

即:

<table> 
    <thead><tr><td>title</td></tr></thead> 
    <template iterate="section in sections"> <!-- can't do this... :-(--> 
    <tbody iterate="row in section"> 
     <tr iterate="cell in row"> 
     <td> {{cell}} </td> 
     </tr> 
    </tbody> 
    </template> 
</table> 

因为我们要像

<table> 
    <thead> ... some headers here </thead> 
    <tbody> .. content1 .. </tbody> 
    <tbody> .. content2 .. </tbody> 
    ... 
    <tbody> .. content N .. </tbody> 
</table> 

+0

不幸的是,我不认为你可以。我猜这里最好的办法是用CSS类获取视觉效果,并将所有内容都放在一个'tbody'下面。 – 2013-03-03 23:48:20

+0

这是一个很好的问题。我在这里开了一个错误:https://github.com/dart-lang/web-ui/issues/379 – 2013-03-04 01:14:00

+0

好消息,这将得到修复。详情请进,但请查看https://github.com/dart-lang/html5lib/issues/46 – 2013-03-05 01:41:42

回答