]> granicus.if.org Git - apache/commitdiff
introduce data tables
authorAndré Malo <nd@apache.org>
Sat, 27 Nov 2004 15:26:55 +0000 (15:26 +0000)
committerAndré Malo <nd@apache.org>
Sat, 27 Nov 2004 15:26:55 +0000 (15:26 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@106722 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/style/css/manual.css
docs/manual/style/xsl/common.xsl

index 9411c0f8e2b12eb33fee43762f7b09d828334bd5..484688f19ccfe9610c8bf31848c25f43c8e16dab 100644 (file)
@@ -358,6 +358,16 @@ td.centered {
     text-align: center;
 }
 
+td.data {
+    font-family: monospace;
+    text-align: right;
+    padding-left: 1em;
+}
+
+th.data {
+    text-align: right;
+}
+
 tr.odd { /* for large tables alternating colors */
     background-color: #f2f2f2;
 }
index 3e801f5698c2abc6c2affa9a92f84ce78e2ac68e..9a4e659ff908444d4f339c6624e200634e7b75b5 100644 (file)
         <xsl:comment>
             &lf;
             <xsl:text>        </xsl:text>
-            <xsl:text>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</xsl:text>
+            <xsl:text>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</xsl:text>
+            <xsl:text>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</xsl:text>
             &lf;
             <xsl:text>              </xsl:text>
-            <xsl:text>This file is generated from xml source: DO NOT EDIT</xsl:text>
+            <xsl:text>This file is generated from xml source: </xsl:text>
+            <xsl:text>DO NOT EDIT</xsl:text>
             &lf;
             <xsl:text>        </xsl:text>
-            <xsl:text>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</xsl:text>
+            <xsl:text>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</xsl:text>
+            <xsl:text>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</xsl:text>
             &lf;
             <xsl:text>      </xsl:text>
         </xsl:comment>
 </xsl:template>
 <!-- /related/directivelist -->
 
+
 <!-- ==================================================================== -->
 <!-- <table>                                                              -->
 <!-- ==================================================================== -->
         <xsl:attribute name="class">bordered</xsl:attribute>
     </xsl:if>
 
-    <!-- style="zebra": alternating colors per row, i.e. every second row -->
-    <!--                gets a class="odd". Header lines (no <td>) get a  -->
-    <!--                class="header". These lines will be excluded from -->
-    <!--                the "odd" line count. That way header lines act   -->
-    <!--                interjectional, which creates a better visual and -->
-    <!--                psychological effect.                             -->
     <xsl:choose>
     <xsl:when test="@style = 'zebra'">
-        <xsl:for-each select="tr">
-            <tr>
-                <xsl:choose>
-                <xsl:when test="count(td) = 0">
-                    <xsl:attribute name="class">header</xsl:attribute>
-                </xsl:when>
-
-                <xsl:when
-                    test="position() mod 2 =
-                            (count(preceding-sibling::tr[count(td) = 0]) mod 2)">
-                    <xsl:attribute name="class">odd</xsl:attribute>
-                </xsl:when>
-                </xsl:choose>
-
-                <xsl:apply-templates />
-            </tr>&lf;
-        </xsl:for-each>
+        <xsl:apply-templates select="tr" mode="zebra-table" />
+    </xsl:when>
+    <xsl:when test="@style = 'data'">
+        <xsl:apply-templates select="tr" mode="data-table" />
     </xsl:when>
     <xsl:otherwise>
         <xsl:apply-templates />
 </xsl:template>
 <!-- /table -->
 
+<!-- data-table -->
+<xsl:template match="tr" mode="data-table">
+<!-- style="data": fixed font, padding-left and right alignment for <td>s -->
+<xsl:variable name="cross-table" select="boolean(
+    preceding-sibling::tr/th[1]|following-sibling::tr/th[1])" />
+
+<tr>
+    <xsl:for-each select="node()">
+        <xsl:choose>
+        <xsl:when test="local-name() = 'td'">
+            <td class="data">
+                <xsl:apply-templates select="*|@*|text()" />
+            </td>
+        </xsl:when>
+        <xsl:when test="local-name() = 'th' and
+                        (not($cross-table) or
+                         count(preceding-sibling::*) &gt; 0)">
+            <th class="data">
+                <xsl:apply-templates select="*|@*|text()" />
+            </th>
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:apply-templates select="self::node()" />
+        </xsl:otherwise>
+        </xsl:choose>
+    </xsl:for-each>
+</tr>&lf;
+</xsl:template>
+
+
+<!-- zebra-table -->
+<xsl:template match="tr" mode="zebra-table">
+<!-- style="zebra": alternating colors per row, i.e. every second row -->
+<!--                gets a class="odd". Header lines (no <td>) get a  -->
+<!--                class="header". These lines will be excluded from -->
+<!--                the "odd" line count. That way header lines act   -->
+<!--                interjectional, which creates a better visual and -->
+<!--                psychological effect.                             -->
+<tr>
+    <xsl:choose>
+    <xsl:when test="count(td) = 0">
+        <xsl:attribute name="class">header</xsl:attribute>
+    </xsl:when>
+
+    <xsl:when test="position() mod 2 = (count(preceding-sibling::tr[count(td) = 0]) mod 2)">
+        <xsl:attribute name="class">odd</xsl:attribute>
+    </xsl:when>
+    </xsl:choose>
+
+    <xsl:apply-templates />
+</tr>&lf;
+</xsl:template>
+<!-- /zebra-table -->
+
 
 <!-- ==================================================================== -->
 <!-- <ol>                                                                 -->