Current location: Hot Scripts Forums » General Web Coding » CSS » table problem in IE(of course)


table problem in IE(of course)

Reply
  #1 (permalink)  
Old 08-31-06, 03:55 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
table problem in IE(of course)

Hi,
i recently started working with xml and css, and i found out that IE does not support the display:table option in css. Is there a way to work around this problem? without using html.

Here's the code i'm using at the moment. This is jsut an example of O'Reilly, the book i'm using to learn xml and css:
The xml page:
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/css" href="example.css"?>
<dish>
	<ingredients>
		<ingredient>
			<quantity>1.5 teaspoon</quantity>
			<component>Flower</component>
		</ingredient>
		<ingredient>
			<quantity>2</quantity>
			<component>Eggs</component>
		</ingredient>
		<ingredient>
			<quantity>100g</quantity>
			<component>Sugar</component>
		</ingredient>
		<ingredient>
			<quantity>100g</quantity>
			<component>Butter</component>
		</ingredient>
	</ingredients>
	
	<recepy>
		<step>Mix the flower and eggs all together</step>
		<step>Melt the butter</step>
		<step>Mix the butter and the mixture of flower and eggs all together</step>
	</recepy>
</dish>
The css page:
Code:
dish{ font-family:Arial, Helvetica, sans-serif;
	font-size:small;
}
ingredients{ display: table;
			background-color:#CCFFCC;
			border-style:solid;
			border-color:#FF0000;
			border-width:1;
			margin-left:10pt;
			margin-top:20pt
}
ingredient{ display: table-row;
}
quantity, component{ display:table-cell;
			border-style:dashed;
			border-width:thin;
			border-color:#0099FF}

recepy{ display:block;
		margin-top:12pt;
		margin-left:10pt}
step{ display:list-item;
		list-style-type:none;
			list-style-position:inside;
			counter-increment: step;}
step:before{ content:counter(step)". ";}
This might look a little bit messy, but that's just because i've been messing around with this script, just to see what all the possibilities are.

Greetz and Thanx in advance,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 08-31-06, 09:48 AM
pkcidstudio's Avatar
pkcidstudio pkcidstudio is offline
Coding Addict
 
Join Date: Nov 2005
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
this was from sitepoint article this morning, and is very easy to follow. sometimes you have to work around IE which is a pain. especially when it will coem to your footer.
Quote:
HTML Tables are not Evil

Sure, you can go to great lengths to reproduce the behaviour of tables using CSS, but sometimes tables are exactly what you should use.

Let's try this again. From Susan Douglas:


“I am currently on the fence between CSS and tables. […] How do I create columns in a list? For instance, a list of books with titles and authors. Or a list with edit and delete buttons. On a typewriter (or in Notepad) I would use tabs. I stick with tables because I can get it to line up the way I want.”


A list with columns—why, that sounds like the definition of a table to me! The choice to use CSS for page layout does not mean you should swear off ever using HTML tables. Information that is naturally presented using rows and columns (so-called tabular data) can and should be marked up using tables.

With this in mind, here's what your markup should look like:

<table>
<thead>
<tr>
<th scope="col">Title</th>
<th scope="col">Author</th>
<th scope="col">Year</th>
</tr>
</thead>
<tbody>
<tr>
<td><cite>The JavaScript
Anthology</cite></td>
<td>James Edwards &amp; Cameron Adams</td>
<td>2006</td>
</tr>
<tr>
<td><cite>The CSS Anthology</cite></td>
<td>Rachel Andrew</td>
<td>2005</td>
</tr>
<tr>
<td><cite>The PHP Anthology</cite></td>
<td>Harry Fuecks</td>
<td>2003</td>
</tr>
</tbody>
</table>

…which is just an HTML table—nothing fancy. Where CSS comes in is in presenting this table so that it looks like a list. First, we can the thead element, which contains the row of header cells:

thead {
display: none;
}

Depending on which browsers you need to support, there are better ways of doing this so that the content of the table headers is still seen by screen readers, but because the column structure of the data isn't especially important in this case we can get away with simply hiding them.

Next, we can style the book titles so that they look like a bulleted list:

cite {
display: list-item;
list-style-type: disc;
margin-left: 2em;
}

That's it! Way simpler than attempting to lay out the information without a table, as I did last issue, and the HTML table reinforces the meaning of the data to be displayed.
hope it helps.
__________________
learning like everyone else
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 09-01-06, 09:09 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
thanx for the reply, but that's not really what i need:
this article is about converting a table into a list, and that's not what i want. I have to use the xml-tags (ingredients, ingredient, component and quantity, in this case) and make a table of it.

if i do this in Mozilla Firefox, everything works perfectly. But IE does not support the display:table option in css, to be more precisly: it isn't display table rows. it creates the table, but all data that should be spread over rows are listed in 1 row.

the reason why i'm not using html, is because i'm learning a little bit about xml.
If there's no sollution for the table problem, i will switch to xslt to transform my xml into html. But first, i wonna give css a try.

thanx,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 09-01-06, 10:40 AM
pkcidstudio's Avatar
pkcidstudio pkcidstudio is offline
Coding Addict
 
Join Date: Nov 2005
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
i found a few more links and i hope one helps, just trying to help here.
http://veerle.duoh.com/index.php/blo.../displaytable/
http://www.456bereastreet.com/archiv...h_css_part_ii/
http://www.webmasterworld.com/forum83/9089.htm
it does apear from my searching that ie doesnt reconize the display: table but these people came up with some work arounds. just trying to help out.
__________________
learning like everyone else
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 09-01-06, 10:52 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
thanx, i'll have a look.
the first site i allready visited 5 mins ago . i have a small problem with the third website as it gives an error:
Quote:
status: error:5 Login required from your ISP due to robotic abuse from your fellow ISP users. .be
anyway, i really appriciate your help. i'll have a look, and i'll post back if i still have my problem.

thanx,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with counting rows in a table kittenesque PHP 5 06-23-05 10:21 AM
Problem with table and form gharryh HTML/XHTML/XML 2 08-06-04 12:47 AM
problem with dynamic table noviceforever JavaScript 3 07-10-04 11:16 AM
Problem with a sort table js function tdubyou JavaScript 0 05-03-04 10:19 AM
table problem AlexGM14 HTML/XHTML/XML 1 01-11-04 03:18 PM


All times are GMT -5. The time now is 12:50 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.