WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/14/2015 10:13:03 PM (7 years ago)
Author:
helen
Message:

List tables: Use CSS :nth-child() selectors for zebra striping.

Note that this does not fix issues related to comment quick edit. Internal linking also continues to use the .alternate class for now. IE8 and below gracefully degrade by not having zebra striping.

There is some hoop jumping with adding an extra table row to maintain zebra striping during quick edit. Documenting that here for future reference; it is also in the inline documentation.

fixes #30981 and #26060. see #25060.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r31167 r31181  
    954954     */
    955955    protected function get_table_classes() {
    956         return array( 'widefat', 'fixed', $this->_args['plural'] );
     956        return array( 'widefat', 'fixed', 'striped', $this->_args['plural'] );
    957957    }
    958958
     
    10291029     */
    10301030    public function single_row( $item ) {
    1031         static $row_class = '';
    1032         $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
    1033 
    1034         echo '<tr' . $row_class . '>';
     1031        echo '<tr>';
    10351032        $this->single_row_columns( $item );
    10361033        echo '</tr>';
Note: See TracChangeset for help on using the changeset viewer.