2013-03-03 61 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

回答