Skip to content

Commit

Permalink
enhance table formatting capability
Browse files Browse the repository at this point in the history
  • Loading branch information
TomCafferty committed Nov 9, 2013
1 parent bfbd3b8 commit 2e5f716
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion syntax.php
Expand Up @@ -219,14 +219,16 @@ function render($mode, &$renderer, $data) {
$renderer->doc .= '</th>';
}
$renderer->doc .= "</tr>\n";
$count=1;
foreach ($result as $row) {
$renderer->doc .= '<tr>';
$renderer->doc .= '<tr class="row'.$count.'">';
foreach ($row as $cell) {
$renderer->doc .= '<td>';
$renderer->cdata($cell);
$renderer->doc .= '</td>';
}
$renderer->doc .= "</tr>\n";
if ($this->table_class != "sortable") $count++;
}
$renderer->doc .= '</tbody></table>';
$this->_sqlRaw__drop_temp_db ($db, &$renderer);
Expand Down

1 comment on commit 2e5f716

@TomCafferty
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can now not only use the class "sortable" to style your table but you can also use instead the oddeven plugin to format the rows alternately.

Please sign in to comment.