Title: Zebra Stripe Short Code Syntax
Last modified: October 21, 2016

---

# Zebra Stripe Short Code Syntax

 *  Resolved [mjs111](https://wordpress.org/support/users/mjs111/)
 * (@mjs111)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/zebra-stripe-short-code-syntax/)
 * I’m new here and just installed the Google inline spreadsheet viewer for WordPress.
   I was referred here for help. I’d like to add zebra striping using the short 
   codes but haven’t figured out the right syntax yet. Right now my short code line
   looks something like this:
 * [gdoc key=”ABCDEFG” datatables_page_length=”25″]
 * I want to add to this short code line the datatables_stripeClasses option, with
   two elements in the array for alternating stripes. I’ve tried a few guesses at
   the syntax but haven’t succeeded yet.
 * I tried the datatables.net forum but didn’t get any responses. I’m not sure if
   that’s the best place for gdoc-specific short code syntax though.
 * Thanks for any help! By the way, this plugin is great. I tried making a donation
   but the PayPal link was bad. When the link works I’m happy to donate for the 
   great work on this.
 * Mike

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [mjs111](https://wordpress.org/support/users/mjs111/)
 * (@mjs111)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/zebra-stripe-short-code-syntax/#post-8340409)
 * PayPal link works now. Sent you donation for the awesome work.
 * Thanks!
 * Mike
 *  Plugin Author [Meitar](https://wordpress.org/support/users/meitar/)
 * (@meitar)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/zebra-stripe-short-code-syntax/#post-8340461)
 * Thanks for the donation. 🙂
 * You may want to take a closer look at the [Other Notes](https://wordpress.org/plugins/inline-google-spreadsheet-viewer/other_notes/)
   page. The shortcode attributes for the DataTables API use underscore-separated
   syntax. This means `datatables_stripeClasses` should be changed to `datatables_stripe_classes`.
   That might be why the plugin is not recognizing this option for you.
 *  Thread Starter [mjs111](https://wordpress.org/support/users/mjs111/)
 * (@mjs111)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/zebra-stripe-short-code-syntax/#post-8340540)
 * Thanks, Meitar!
 * I’m still getting up to speed on the gdoc syntax for the arguments. The docs 
   on the web for datatables gives you what you need if you’re writing javascript
   but I think I’m still screwing up syntax-wise when transferring that to the gdoc
   short codes. I tried this:
 * [gdoc key=”ABCDEFG” datatables_page_length=”25″ datatables_stripe_classes=”strip1
   strip2″]
 * but no luck. I also tried some variations like no arguments (thinking maybe there
   was a two stripe default), a comma between array entries, and a single integer
   to see if that would specify the number of array entries but no luck yet.
 *  Plugin Author [Meitar](https://wordpress.org/support/users/meitar/)
 * (@meitar)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/zebra-stripe-short-code-syntax/#post-8450611)
 * > The docs on the web for datatables gives you what you need if you’re writing
   > javascript but I think I’m still screwing up syntax-wise when transferring 
   > that to the gdoc short codes.
 * Actually, the shortcode syntax _also_ uses JavaScript in its value. The gotcha
   is that with arrays in JavaScript use the square bracket character (`[` and `]`),
   which is also what WordPress uses to denote the start and end of a shortcode 
   itself. You need to URL-encode these in the shortcode value so WordPress doesn’t
   get confused and think you’re done writing your shortcode. This is mentioned 
   in this plugin’s FAQ, have another read of that.
 * The example code on [the DataTables reference manual](https://datatables.net/reference/option/stripeClasses)
   says:
 *     ```
       $('#example').dataTable( {
         "stripeClasses": [ 'strip1', 'strip2', 'strip3' ]
       } );
       ```
   
 * so I would expect a shortcode like this to be equivalent:
 *     ```
       [gdoc key="" datatables_stripe_classes='%5B"strip1", "strip2", "strip3"%5D']
       ```
   
    -  This reply was modified 9 years, 6 months ago by [Meitar](https://wordpress.org/support/users/meitar/).
      Reason: fixed copy-paste error

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Zebra Stripe Short Code Syntax’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/inline-google-spreadsheet-viewer.
   svg)
 * [Inline Google Spreadsheet Viewer](https://wordpress.org/plugins/inline-google-spreadsheet-viewer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/inline-google-spreadsheet-viewer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/)
 * [Active Topics](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Meitar](https://wordpress.org/support/users/meitar/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/zebra-stripe-short-code-syntax/#post-8450611)
 * Status: resolved