I’m having a bit of trouble getting my can.Component view to display properly in a table. Currently I have my component’s view containing a
Component Extend
can.Component.extend({
tag: 'syndicate-feed-subscription',
template: can.view('existing_syndicate_feed'),
viewModel: {
item: null,
page_config: null,
current_view_state: null,
application: "syndicate"
}
});
Component View
<script type="text/mustache" id="existing_syndicate_feed">
<tr id="feed_{{id}}" class="feed_row">
<td class="feed_title_column">{{title}}</td>
<td class="feed_url_column">{{url}}</td>
<td class="feed_policy_column">**Policy**</td>
<td class="feed_links_column">
<a id="edit_feed_{{id}}" class="action_link edit_feed_link" href="#">Edit</a>
<a id="remove_feed_{{id}}" class="action_link remove_feed_link" href="#">Remove</a>
</td>
</tr>
</script>
Containing Table
<script type="text/mustache" id="feeds_list" class="editor_box">
<div class="editor_box">
<span class="accent_header">
#{t "syndicate.feeds.existing_feed_section"}
</span><br/>
{{#feeds.length}}
<table class="feeds_list" style="width: 100%;">
<tr>
<th class="feed_title_column">#{ t "syndicate.feeds.feed_title_header" }</th>
<th class="feed_url_column">#{ t "syndicate.feeds.feed_url_header" }</th>
<th class="feed_policy_column">#{ t "syndicate.feeds.feed_policy_header" }</th>
<th></th>
</tr>
{{#feeds}}
<syndicate-feed-subscription item="{feed}"></syndicate-feed-subscription>
{{/feeds}}
</table>
{{/feeds.length}}
{{^feeds.length}}
<p>No existing feeds to display</p>
{{/feeds.length}}
</div>
</script>
Page Layout
Borders around table, tr, th, td to demonstrate weird formatting.