HTML Error fouling-up CSS?
-
I am trying to use the CSS code mentioned in the FAQ to give different background colors to odd/even rows of my spreadsheet. However, it appears that the HTML code generated by this plugin has an error which prevents the odd/even classes from being used.
Here’s the code you provided in the FAQ:
.igsv-table tr.odd { /* styles for odd-numbered rows (row 1, 3, 5...) */ } .igsv-table tr.even { /* styles for even-numbered rows (row 2, 4, 6...) */ }Added that CSS code to my website (with actual colors within the brackets):
.igsv-table tr.odd { background-color:#eeeeee; /* styles for odd-numbered rows */ } .igsv-table tr.even { background-color:#dddddd; /* styles for even-numbered rows */ }But nothing happened, and here’s why — check the HTML output shown when I use “view source” in my browser:
<tr id="igsv-(key-redacted)-row-2"class="row-2"even">When I view it in the browser inspector, the code looks slightly different, but perhaps much easier to spot the error:
<tr id="igsv-(key-redacted)-row-2" class="row-2" even"="">Long story short, looks like there’s one (or more) too many quotation marks in every single tr tag. The code for the columns is correct:
class="col-1 odd"
Notice how the column number AND the odd/even attribute are nested within the same set of quotation marks. By contrast, the row tags have that extra quote, which sets the even/odd attribute outside of the quotes, causing the browser to see both odd=”” or even=”” as independent attributes. If the errant quotation mark could be removed, that would be wonderful.(Ideally, it would be great if the plugin could simply carry-in the background colors from the original spreadsheet as it appears in Google Docs, but I digress. The plugin is still very great, and if this one bug could be resolved so I can “zebra-stripe” my rows, I’d be happy enough to donate.)
The topic ‘HTML Error fouling-up CSS?’ is closed to new replies.