Tecnologías XML / ePUB / Open Publication Structure / Tablas / Tablas con celdas combinadas

(Extracto de «E-Books mit ePUB ─ Von Word zum E-Book mit XML» de Dr. Victor Wang)

Combinar celdas horizontal o verticalmente crea extensiones, controladas por los atributos colspan para la horizontal y rowspan para la vertical. Los enteros indican cuántas celdas combinar desde la actual. El ejemplo combina las dos últimas celdas de las filas 2 y 3:

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
  <head>
     <title>Tabellen in XHTML</title>
     <link rel="stylesheet" type="text/css" href="xhtml-styles.css"/>
  </head>
  <body>
     <div class="Gliederungsebene">
      . . .
      <h1>Tabelle horizontaler Überspannung (colspan=2)</h1>
      <table border="1" width="400">
         <caption>Wichtige Elemente in DTBook</caption>
         <col width="25%"/>
         <col width="50%"/>
         <col width="25%"/>
         <thead>
            <tr>
               <th>Zeile</th>
               <th>Elementname</th>
               <th>Bedeutung</th>
               <th>Besondere Attribute</th>
            </tr>
         </thead>
         <tbody>
            <tr>
               <td>1</td>
               <td>level</td>
               <td>Kapitelstruktur/Ebene in DTBook</td>
               <td>depth</td>
            </tr>
            <tr>
               <td>2</td>
               <td>hd</td>
               <td colspan="2">Überschrift einer Level-Ebene in DTBook</td>
            </tr>
            <tr>
               <td>3</td>
               <td>p</td>
               <td colspan="2">Absatz in DTBook</td>
            </tr>
         </tbody>
      </table>
     </div>
  </body>
</html> 

Ejemplo de código: celdas combinadas en XHTML

Tabla XHTML con Colspan (Adobe Digital Editions) Tabla XHTML con Colspan (iBooks)

Figuras: tabla XHTML con Colspan (Adobe Digital Editions e iBooks)

Adobe Digital Editions e iBooks muestran los resultados anteriores. Las celdas combinadas tienen fondo gris definido en la hoja de estilo para distinguirlas.

 

<< atrás

siguiente >>

 

 

 

volver arriba