View Full Version : Tableformatting with Dekiscript
craigsivils
07-25-2008, 03:13 PM
I am trying to use Dekiscript to format the output of a new WikiInfo extention, but I cannot seem to get the rows to alternate colors. I have looked at the example that does this and tried to duplicate it with no luck.
Here is my working code (without row formatting).
Craig
<table cellspacing="1" cellpadding="1" width="95%" border="1">
<tbody>
<tr>
<td><strong>User</strong></td>
<td><strong>Last Active</strong></td>
</tr>
<tr foreach="var f in wikiinfo.recentusers(30)">
<td>{{f.user}}</td>
<td>{{f.lastactive}}</td>
</tr>
</tbody>
</table>
craigsivils
07-25-2008, 03:30 PM
This does not seem to work. I have checked the html and the class is getting set to feedroweven/feedrowodd, but the rows are not shaded.
<table cellspacing="1" cellpadding="1" width="95%" border="1">
<tbody>
<tr>
<td><strong>User</strong></td>
<td><strong>Last Active</strong></td>
</tr>
<tr class="{{__count % 2 == 0 ? 'feedroweven' : 'feedrowodd'}}" foreach="var f in wikiinfo.recentusers(30)">
<td>{{f.user}}</td>
<td>{{f.lastactive}}</td>
<td>{{__count}}</td>
</tr>
</tbody>
</table>
craigsivils
07-25-2008, 03:40 PM
This seems to work
<table class="feedtable" cellspacing="1" cellpadding="1" width="95%" border="1">
<tbody>
<tr>
<td><strong>User</strong></td>
<td><strong>Last Active</strong></td>
</tr>
<tr class="{{__count % 2 == 0 ? 'feedroweven' : 'feedrowodd'}}" foreach="var f in wikiinfo.recentusers(30)">
<td>{{f.user}}</td>
<td>{{f.lastactive}}</td>
<td>{{__count}}</td>
</tr>
</tbody>
</table>
SteveB
07-27-2008, 03:50 AM
In 8.05, Roy introduced specialized styles that should be used from now on. It's similar to before, but with different names (table, bg1, bg2):
<table class="table">
<tr foreach="var v in collection" class="{{ __count % 2 ? 'bg2' : 'bg1' }}">
<td>...your output...</td>
</tr>
</table>
Powered by vBulletin™ Version 4.1.3 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.