Wrox Programmer Forums
|
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 14th, 2007, 10:46 AM
Authorized User
 
Join Date: Feb 2007
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to toddw607 Send a message via Yahoo to toddw607
Default CSS for XML in ASP.NET

     I have a XML file that displays info including tables but the tables are not formatting correctly. This is the only thing I have in my CSS that references tables:
                      TABLE { display:table }
                      ROW { display:table-row }
                      CELL { display:table-cell }


          Here is an example of one of my tables:

                           <TABLE>
<CAPTION>
<TableTitle>
<A ID="pgfId-1026394"></A>
<A ID="75579"></A>
CAB LIGHT Switch Logic</TableTitle>
</CAPTION>
<ROW>
<TH ROWSPAN="1" COLSPAN="1">
<Body-Bold-Center>
<A ID="pgfId-1026400"></A>
Switch Position</Body-Bold-Center>
</TH>
<TH ROWSPAN="1" COLSPAN="1">
<Body-Bold-Center>
<A ID="pgfId-1026402"></A>
Incandescent</Body-Bold-Center>
</TH>
<TH ROWSPAN="1" COLSPAN="1">
<Body-Bold-Center>
<A ID="pgfId-1026404"></A>
Fluorescent</Body-Bold-Center>
</TH>
</ROW>
<ROW>
<CELL ROWSPAN="1" COLSPAN="1">
<Body>
<A ID="pgfId-1026406"></A>
OFF</Body>
</CELL>
<CELL ROWSPAN="1" COLSPAN="1">
<Body>
<A ID="pgfId-1026408"></A>
Off</Body>
</CELL>
<CELL ROWSPAN="1" COLSPAN="1">
<Body>
<A ID="pgfId-1026410"></A>
Off</Body>
</CELL>
</ROW>
<ROW>
<CELL ROWSPAN="1" COLSPAN="1">
<Body>
<A ID="pgfId-1026412"></A>
READING</Body>
</CELL>
<CELL ROWSPAN="1" COLSPAN="1">
<Body>
<A ID="pgfId-1026414"></A>
On</Body>
</CELL>
<CELL ROWSPAN="1" COLSPAN="1">
<Body>
<A ID="pgfId-1026416"></A>
Off</Body>
</CELL>
</ROW>
<ROW>
<CELL ROWSPAN="1" COLSPAN="1">
<Body>
<A ID="pgfId-1026418"></A>
BOTH</Body>
</CELL>
<CELL ROWSPAN="1" COLSPAN="1">
<Body>
<A ID="pgfId-1026420"></A>
On</Body>
</CELL>
<CELL ROWSPAN="1" COLSPAN="1">
<Body>
<A ID="pgfId-1026422"></A>
On</Body>
</CELL>
</ROW>
<ROW>
<CELL ROWSPAN="1" COLSPAN="1">
<Body>
<A ID="pgfId-1026424"></A>
CEILING</Body>
</CELL>
<CELL ROWSPAN="1" COLSPAN="1">
<Body>
<A ID="pgfId-1026426"></A>
Off</Body>
</CELL>
<CELL ROWSPAN="1" COLSPAN="1">
<Body>
<A ID="pgfId-1026428"></A>
On</Body>
</CELL>
</ROW>
</TABLE>

    The table has 3 columns, a header row and 4 data rows. When I run the xml the table comes up with no borders at all, the header titles in the center of the screen and the data columns aligned with the left side of the screen. Any thoughts at all? Thanks and regards.

 
Old July 19th, 2007, 01:34 PM
Friend of Wrox
 
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

Hi! :) The display property in CSS only declares a data type. It's like declaring that your variable is an integer. And while it's necessary because you've defined your own XML tags, you haven't affected the appearance beyond establishing basic table structure. If you want to define the borders you need to use the border property.

TABLE {
display:table;
border: 2px solid #000000;
}

There's also a text-align property that you can set to left, right, and center. It is not well-behaved though, but the borders should work fine.

-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET 3.5 Advanced CSS Question aspcoder BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 April 28th, 2008 03:58 AM
CSS anomolies in ASP.NET David_0223 ASP.NET 2.0 Basics 1 March 27th, 2008 03:06 PM
CSS for XML in ASP.NET toddw607 ASP.NET 2.0 Basics 3 June 19th, 2007 09:29 AM
CSS and ASP.net conflict joecoleman ASP.NET 2.0 Basics 2 June 1st, 2006 07:55 AM
Styles.CSS in ASP.NET rajen CSS Cascading Style Sheets 2 July 22nd, 2005 04:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.