Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Formatting table colour is messing up Javascript

Featured Replies

I've setup a table to calculate cells but i'm having trouble with formatting the colors within the table. When I make certain changes, the table calculations stop working. I've uploaded some examples:

 

www.fluxcreative.co.uk/first.html

 

In this example, the lines numbered 2-6 total at the bottom when checked as they should do.

but after changing the code for line 1 (so the row changes color when checked), the line has stopped adding to the totals

 

Line 1 is almost formatted correctly but you'll notice it is white when the page loads, turquoise when checked then reverts to light purple. The light purple is the color it should be before the box is checked but because the line colors alternate, I don't wanna change the BG color of the whole table. So i've added some code to set odd numbered rows to dark and even numbers to light, so line 1 now works how it should do color-wise (see below).

 

www.fluxcreative.co.uk/second.html

 

But now, all lines have stopped adding up!!! I've put this together from snippets on google but I don't really understand CSS well enough to work this out. Color and functionality are both very important for this site but I can't get them working together. Can someone please tell me where i'm going wrong? Thanks guys, Dren

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.