-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarification on use of template repeat for <tr> & <select> #318
Comments
Until the addition of the Trying to use other elements would result in them becoming unexpected siblings! Therefore, the HTMLTemplateElement polyfill in the TemplateBinding library has the ability to use an @ebidel It should probably be noted that browsers with native |
So I should change <thead>
<tr>
<template repeat="{{ header in thead }}">
<th>{{header}}</th>
</template>
</tr>
</thead> to <thead>
<tr>
<th template repeat="{{ header in thead }}">{{header}}</th>
</tr>
</thead> |
For best compatibility, we should recommend the second (polyfill) case? Does the first work in a non supported browser (Safari). Genuinely asking. I'm on my mobile. |
The correct syntax that works in Safari: <table>
<template if="{{ thead }}" >
<thead>
<tr>
<th template repeat="{{ header in thead }}">{{header}}</th>
</tr>
</thead>
</template>
<tbody>
<tr template repeat="{{ tr in tbody }}">
<td template repeat="{{ td in tr }}">{{ td }}</td>
</tr>
</tbody>
</table> |
You guys sorted it out correctly. Browsers which don't support TemplateBinding supports 'semantic templates' for all of theses elements: https://github.com/Polymer/TemplateBinding/blob/master/src/TemplateBinding.js#L117 The docs should be clear that using templates in these locations should prefer the "semantic" version, unless all target browsers implement native template. |
Beefed up the section on this in the FAQ: Polymer/old-docs-site@f13b54a |
I'm putting together a simple data table and was directed to this FAQ on using
<tr>
elements. Could someone expound on why these elements are different and the importance of the different setup?Thanks!
The text was updated successfully, but these errors were encountered: