154 CHAPTER 5 DISPLAYING XML USING CSS (Web design course)
Saturday, September 15th, 2007154 CHAPTER 5 DISPLAYING XML USING CSS You can see that the elements that translate to table cells have set the float property. Figure 5-17 shows the result when you view the XML document in a web browser. It displays correctly in IE, Opera, Firefox, and Netscape. Figure 5-17. Displaying tabular XML data using floating elements If you shade the rows, as in this example, you have to set the height of the rows so that the cells fit within them; otherwise, you ll see an offset where the cell is larger than the row. To use this method, you need to know the number of columns in the table so that you can set the cell and row widths correctly. If you don t do this, you may run into problems, such as cells wrapping across multiple rows. Table Row Spans The only way to achieve the equivalent of a rowspan or colspan attribute in XHTML is to use additional floating elements. The structure that you use depends heavily on the structure of your XML document. I ll leave you to experiment to see what effects you can achieve. Tip The use of the float property with a value of right is helpful in displaying the table cells in an order different from that in the original XML document. Linking Between Displayed XML Documents The simplicity of hyperlinks is undoubtedly one of the reasons for the success of the web. Web browsers understand and can interpret the meaning of an tag. XML has no equivalent to this tag. If you style XML documents with CSS, you need a way to indicate that an element is a link. The CSS specifications don t address this topic.
Check Tomcat Web Hosting services for best quality webspace to host your web application.