XML technologies / ePUB / ePub für (In)Designer / Refining tables / Designing alternating fills

(Excerpt from “ePub für (In)Designer — Mit InDesign Schritt für Schritt zum E-Book” by Sascha Heck & Yves Apel)

InDesign can automatically apply alternating table fills. Our example alternates two colors.

Defining alternating table fills in InDesign

Figure: To define alternating fills, place the cursor in the table
and choose Table → Table Options → Alternating Fills.

InDesign will not automatically produce this in ePub. Assign each row its color through CSS. In the HTML file, assign a class to each element <tr> (= table row). In CS5, create and define the class; in CS5.5, create a second class because every row was exported with the same one.

<tr class="AbwechselndeFlaeche1">

When a <tr> tag closes and a new one starts, assign the new one the second class, for example:

<tr class="AbwechselndeFlaeche2">

Assigning separate CSS classes for table colors to the <tr> elements

Figure: Assigning separate CSS classes for table colors to the <tr> elements.

Alternately assign the appropriate class to each <tr> tag. Then switch to CSS and add the two classes with their cell background-color definitions.

tr.AbwechselndeFlaeche1 {
  background-color: #ebe1c3;
}

tr.AbwechselndeFlaeche2 {
  background-color: #fffbe7;
}

Table after CSS adjustment

Figure: Table after CSS adjustment.

  

 

 

 

back to top