Style statistics table alternate rows
This commit is contained in:
15
helpers.php
15
helpers.php
@@ -187,12 +187,15 @@ if ( ! function_exists( 'sp_post_table' ) ) {
|
|||||||
$ids = array_slice( $ids, $offset, $length );
|
$ids = array_slice( $ids, $offset, $length );
|
||||||
endif;
|
endif;
|
||||||
endif;
|
endif;
|
||||||
|
$i = 0;
|
||||||
foreach ( $ids as $id ):
|
foreach ( $ids as $id ):
|
||||||
if ( !$id ) continue;
|
if ( !$id ) continue;
|
||||||
if ( $data )
|
if ( $data )
|
||||||
$data_values = (array)get_post_meta( $id, $data, false )
|
$data_values = (array)get_post_meta( $id, $data, false )
|
||||||
?>
|
?>
|
||||||
<tr class="sp-post<?php
|
<tr class="sp-post<?php
|
||||||
|
if ( $i % 2 == 0 )
|
||||||
|
echo ' alternate';
|
||||||
if ( $data ):
|
if ( $data ):
|
||||||
echo ' sp-filter-0';
|
echo ' sp-filter-0';
|
||||||
foreach ( $data_values as $data_value ):
|
foreach ( $data_values as $data_value ):
|
||||||
@@ -200,20 +203,20 @@ if ( ! function_exists( 'sp_post_table' ) ) {
|
|||||||
endforeach;
|
endforeach;
|
||||||
endif;
|
endif;
|
||||||
?>">
|
?>">
|
||||||
<td>
|
<td><?php echo get_the_title( $id ); ?></td>
|
||||||
<label class="selectit">
|
|
||||||
<?php echo get_the_title( $id ); ?>
|
|
||||||
</label>
|
|
||||||
</td>
|
|
||||||
<td><input type="number" value="1" /></td>
|
<td><input type="number" value="1" /></td>
|
||||||
<td><input type="number" value="2" /></td>
|
<td><input type="number" value="2" /></td>
|
||||||
<td><input type="number" value="3" /></td>
|
<td><input type="number" value="3" /></td>
|
||||||
<td><input type="number" value="4" /></td>
|
<td><input type="number" value="4" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
$i++;
|
||||||
endforeach;
|
endforeach;
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr<?php
|
||||||
|
if ( $i % 2 == 0 )
|
||||||
|
echo ' class="alternate"';
|
||||||
|
?>>
|
||||||
<td><strong>Total</strong></td>
|
<td><strong>Total</strong></td>
|
||||||
<td><input type="number" value="1" /></td>
|
<td><input type="number" value="1" /></td>
|
||||||
<td><input type="number" value="2" /></td>
|
<td><input type="number" value="2" /></td>
|
||||||
|
|||||||
Reference in New Issue
Block a user