Fix frontend scrollable table styling

This commit is contained in:
Brian Miyaji
2014-05-09 18:56:54 +10:00
parent b9004101c1
commit 11fc488992
11 changed files with 27 additions and 23 deletions

View File

@@ -1,8 +1,13 @@
/* SportsPress */
.sp-scrollable-table-wrapper {
overflow: auto;
}
/* Data Tables */
.sp-data-table {
width: 100%;
position: relative;
}
.sp-data-table thead .sorting,
.sp-data-table thead .sorting_asc,
@@ -122,7 +127,6 @@
}
.sp-event-blocks .team-logo {
width: 20%;
height: auto;
margin: 10px;
}
.sp-event-blocks .logo-odd {

View File

@@ -94,8 +94,8 @@ if ( isset( $columns ) )
?>
</tbody>
</table>
<?php
if ( $id && $show_all_events_link )
echo '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all events') . '</a>';
?>
</div>
<?php
if ( $id && $show_all_events_link )
echo '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all events') . '</a>';
?>

View File

@@ -30,7 +30,7 @@ if ( $seasons ):
endif;
?>
<h3><?php echo SP()->text->string('Details'); ?></h3>
<div class="sp-table-wrapper">
<div class="sp-table-wrapper sp-scrollable-table-wrapper">
<table class="sp-event-details sp-data-table">
<thead>
<tr>

View File

@@ -35,7 +35,7 @@ $usecolumns = $calendar->columns;
if ( isset( $columns ) )
$usecolumns = $columns;
?>
<div class="sp-table-wrapper">
<div class="sp-table-wrapper sp-scrollable-table-wrapper">
<table class="sp-event-list sp-data-table<?php if ( $responsive ) { ?> sp-responsive-table<?php } if ( $paginated ) { ?> sp-paginated-table<?php } ?>" data-sp-rows="<?php echo $rows; ?>">
<thead>
<tr>
@@ -163,8 +163,8 @@ if ( isset( $columns ) )
?>
</tbody>
</table>
<?php
if ( $id && $show_all_events_link )
echo '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all events') . '</a>';
?>
</div>
<?php
if ( $id && $show_all_events_link )
echo '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all events') . '</a>';
?>

View File

@@ -41,7 +41,7 @@ foreach( $teams as $key => $team_id ):
$data = sp_array_combine( $players, sp_array_value( $stats, $team_id, array() ) );
?>
<h3><?php echo get_the_title( $team_id ); ?></h3>
<div class="sp-table-wrapper">
<div class="sp-table-wrapper sp-scrollable-table-wrapper">
<table class="sp-event-performance sp-data-table <?php if ( $responsive ) { ?> sp-responsive-table<?php } if ( $has_players && $sortable ) { ?> sp-sortable-table<?php } ?>">
<thead>
<tr>

View File

@@ -33,7 +33,7 @@ if ( empty( $results ) )
return false;
foreach( $results as $team_id => $result ):
if ( sp_array_value( $result, 'outcome', '-1' ) != '-1' ):
if ( count( array_filter( $results ) ) ):
if ( $show_outcomes ):
$outcomes = array();
@@ -85,7 +85,7 @@ else:
$output .= '<h3>' . SP()->text->string('Team Results') . '</h3>';
$output .= '<div class="sp-table-wrapper">' .
$output .= '<div class="sp-table-wrapper sp-scrollable-table-wrapper">' .
'<table class="sp-event-results sp-data-table sp-responsive-table"><thead>' .
'<th class="data-name">' . SP()->text->string('Team') . '</th>';
foreach( $result_labels as $key => $label ):

View File

@@ -25,7 +25,7 @@ $defaults = array(
extract( $defaults, EXTR_SKIP );
$output = '<div class="sp-table-wrapper">';
$output = '<div class="sp-table-wrapper sp-scrollable-table-wrapper">';
if ( $show_caption ):
$output .= '<h4 class="sp-table-caption"><a href="' . get_post_permalink( $id ) . '">' . get_the_title( $id ) . '</a></h4>';
@@ -102,9 +102,9 @@ endforeach;
$output .= '</tbody>' . '</table>';
$output .= '</div>';
if ( $show_full_table_link )
$output .= '<a class="sp-league-table-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View full table') . '</a>';
$output .= '</div>';
echo $output;

View File

@@ -68,7 +68,7 @@ foreach ( $groups as $group ):
if ( ! empty( $group->name ) )
$output .= '<h3 class="sp-list-group-name">' . $group->name . '</h3>';
$output .= '<div class="sp-table-wrapper">' .
$output .= '<div class="sp-table-wrapper sp-scrollable-table-wrapper">' .
'<table class="sp-player-list sp-data-table' . ( $responsive ? ' sp-responsive-table' : '' ) . ( $sortable ? ' sp-sortable-table' : '' ) . ( $paginated ? ' sp-paginated-table' : '' ) . '" data-sp-rows="' . $rows . '">' . '<thead>' . '<tr>';
if ( in_array( $orderby, array( 'number', 'name' ) ) ):

View File

@@ -30,7 +30,7 @@ if ( empty( $data ) )
return false;
$output = '<h4 class="sp-table-caption">' . $league->name . '</h4>' .
'<div class="sp-table-wrapper">' .
'<div class="sp-table-wrapper sp-scrollable-table-wrapper">' .
'<table class="sp-player-performance sp-data-table' . ( $responsive ? ' sp-responsive-table' : '' ) . '">' . '<thead>' . '<tr>';
foreach( $labels as $key => $label ):

View File

@@ -33,7 +33,7 @@ if ( is_array( $leagues ) ):
return false;
$output = '<h4 class="sp-table-caption">' . $league->name . '</h4>' .
'<div class="sp-table-wrapper">' .
'<div class="sp-table-wrapper sp-scrollable-table-wrapper">' .
'<table class="sp-player-statistics sp-data-table' . ( $responsive ? ' sp-responsive-table' : '' ) . '">' . '<thead>' . '<tr>';
foreach( $labels as $key => $label ):

View File

@@ -35,7 +35,7 @@ foreach ( $leagues as $league ):
unset( $data[0] );
$output .= '<h4 class="sp-table-caption">' . $league->name . '</h4>' .
'<div class="sp-table-wrapper">' .
'<div class="sp-table-wrapper sp-scrollable-table-wrapper">' .
'<table class="sp-team-columns sp-data-table sp-responsive-table">' . '<thead>' . '<tr>';
foreach( $labels as $key => $label ):