bell notificationshomepageloginedit profileclubsdmBox

10.02% popularity   0 Reactions

Can anyone tell me how to create tables with alternating row colors in an epub? For example, I might want the default background color to be white, but every other row would have a light blue background.

Is there a good way to do that using a basic epub software program like Sigil, or by hand coding the HTML?


Free books android app tbrJar TBR JAR Read Free books online gutenberg


Load Full (2)

Login to follow story

More posts by @Candy

2 Comments

Sorted by latest first Latest Oldest Best

 

@Jamie

10% popularity   0 Reactions

You can use the following CSS rules to style respectively even or odd table rows (See the Example on W3schools):

tr:nth-child(even) {
background-color: #f2f2f2
}

tr:nth-child(odd) {
background-color: #f2f2f2
}


Free books android app tbrJar TBR JAR Read Free books online gutenberg


Load Full (0)

10% popularity   0 Reactions

In HTML just set the fill colours on each row to alternating values some authoring software probably has a table style that does this for you but off the top of my head I can't say which. MS-Word used to author HTML can do this but will probably do it the most verbose way possible, i.e. by having it set on every cell.

You could also do it with 2 styles applied to alternating rows.


Free books android app tbrJar TBR JAR Read Free books online gutenberg


Load Full (0)

 

Back to top