--- a/vstup/css/styl.css Thu Jan 05 12:21:53 2012 +0100
+++ b/vstup/css/styl.css Thu Jan 05 14:49:04 2012 +0100
@@ -99,3 +99,23 @@
background-color: #d0d0f0;
border-radius: 0px 0px 4px 4px;
}
+
+table {
+ border-collapse:collapse;
+}
+td {
+ border: 1px solid black;
+ padding-top: 4px;
+ padding-bottom: 4px;
+ padding-left: 6px;
+ padding-right: 6px;
+}
+thead tr {
+ background: grey;
+ color:black;
+}
+tbody tr:hover {
+ background-color: silver;
+ color:black;
+}
+
--- a/vstup/služby.xml Thu Jan 05 12:21:53 2012 +0100
+++ b/vstup/služby.xml Thu Jan 05 14:49:04 2012 +0100
@@ -12,7 +12,15 @@
<h2>Pravidelné krmení ptáků</h2>
<p>Fusce eu libero sit amet mauris molestie suscipit. Integer porttitor euismod luctus. Sed elementum quam et quam pharetra tincidunt. Pellentesque vitae augue quis mi blandit dapibus. Vestibulum iaculis magna sit amet nisl tristique at consectetur odio blandit. Proin aliquam lectus ac arcu condimentum tempus. Suspendisse potenti. Suspendisse porttitor euismod accumsan. Sed nibh lacus, laoreet id consequat gravida, eleifend eget lectus. Curabitur accumsan, nisi at elementum aliquam, nisl nulla volutpat lorem, ac elementum metus lacus eget lectus. Praesent odio nulla, porttitor vitae hendrerit vel, ullamcorper in velit. Sed in est ipsum, iaculis accumsan sem. Integer pretium ultrices justo a mattis. Nullam id lacus in lectus bibendum tempor. Nulla non viverra eros. Praesent scelerisque, nisi et placerat convallis, nisi nulla lobortis mauris, eu ultricies est mi ac orci. Suspendisse ullamcorper dapibus interdum. Curabitur ac metus eros, sed venenatis sapien.</p>
- <p>Účtováno měsíčním paušálem.</p>
+
+ <m:tabulka>
+ Velikost ptáka;Cena za jedno krmení
+ malý;250
+ střední;500
+ velký;1000
+ </m:tabulka>
+
+ <p>Dodáváme pouze prvotřídní krmivo.</p>
<m:wiki>
Pravidelné krmení savců
@@ -20,9 +28,9 @@
Tato služba je určena především pro pakoně a slony, vhodná je ale i pro jednorožce. _Vivamus nec dictum dolor_. Aliquam et tellus dolor. Curabitur et est sapien. Sed nec neque massa. Markdown Integer luctus erat vel arcu molestie ac dapibus dolor pretium. Curabitur eget augue non ipsum pulvinar venenatis eget et lectus. Proin fringilla aliquet sapien, non luctus est lobortis vel. Nunc vehicula volutpat varius. Aliquam suscipit accumsan sollicitudin. Morbi ultricies, mauris id elementum pellentesque, nunc dolor viverra nisl, sit amet consequat velit libero at ligula. Nulla luctus rhoncus tortor nec sollicitudin. Vivamus posuere sodales ipsum, hendrerit cursus felis pharetra sit amet. Nunc interdum facilisis massa ac congue.
-Aliquam erat volutpat. Quisque vitae libero est. Aliquam erat volutpat. [Integer](http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Integer.html) elementum, nisl nec lacinia facilisis, dolor tellus varius eros, sit amet facilisis sem sapien vitae nulla. Pellentesque habitant morbi tristique senectus et **netus et malesuada** fames ac turpis egestas. Integer rutrum sodales venenatis. Donec mollis aliquet enim, id venenatis urna faucibus sed. Suspendisse pharetra neque et nibh tincidunt suscipit. Morbi ut justo sit amet lectus faucibus tempor quis non libero. Aenean in dolor sem, in lacinia sem.
+Aliquam erat volutpat. Quisque vitae libero est. Aliquam erat volutpat. [Integer](http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html) elementum, nisl nec lacinia facilisis, dolor tellus varius eros, sit amet facilisis sem sapien vitae nulla. Pellentesque habitant morbi tristique senectus et **netus et malesuada** fames ac turpis egestas. Integer rutrum sodales venenatis. Donec mollis aliquet enim, id venenatis urna faucibus sed. Suspendisse pharetra neque et nibh tincidunt suscipit. Morbi ut justo sit amet lectus faucibus tempor quis non libero. Aenean in dolor sem, in lacinia sem.
-Účtováno měsíčním paušálem.
+Dodáváme pouze prvotřídní krmivo.
</m:wiki>
--- a/šablona/stránka.xsl Thu Jan 05 12:21:53 2012 +0100
+++ b/šablona/stránka.xsl Thu Jan 05 14:49:04 2012 +0100
@@ -214,8 +214,36 @@
<xsl:variable name="prostýText" select="document(concat('http://lipsum.lipsum.com/feed/xml?amount=', @odstavců, '&what=paragraphs'))/feed/lipsum"/>
<xsl:for-each select="fn:tokenize($prostýText, '\n')">
<p><xsl:value-of select="."/></p>
- </xsl:for-each>
+ </xsl:for-each>
</xsl:template>
+ <!--
+ Makro pro jednoduché tabulky
+ -->
+ <xsl:template match="m:tabulka">
+ <table>
+ <xsl:variable name="data" select="replace(replace(text(), '^\s+', ''),'\s+$','')"/>
+ <xsl:variable name="hlavička" select="substring-before($data, ' ')"/>
+ <xsl:variable name="tělo" select="substring-after($data, ' ')"/>
+ <thead>
+ <tr>
+ <xsl:for-each select="tokenize($hlavička, ';')">
+ <td><xsl:value-of select="normalize-space(.)"/></td>
+ </xsl:for-each>
+ </tr>
+ </thead>
+ <tbody>
+ <xsl:for-each select="tokenize($tělo, '\n')">
+ <xsl:if test="normalize-space(.)">
+ <tr>
+ <xsl:for-each select="tokenize(., ';')">
+ <td><xsl:value-of select="normalize-space(.)"/></td>
+ </xsl:for-each>
+ </tr>
+ </xsl:if>
+ </xsl:for-each>
+ </tbody>
+ </table>
+ </xsl:template>
</xsl:stylesheet>