XHTML, CSS 2 and Tables - oh my
Posted: Thu Mar 03, 2005 11:58 am
Dann,
I haven't used much xhtml, but you can trick tables by using 'display:table' type attributes, look at http://www.w3schools.com/css/pr_class_display.asp
Here's some code I've been playing around at today, while listening to the show.
That any help? This code probably wont work in MSIE; so I'll probably still use tables and html 4 strict.
Steve
I haven't used much xhtml, but you can trick tables by using 'display:table' type attributes, look at http://www.w3schools.com/css/pr_class_display.asp
Here's some code I've been playing around at today, while listening to the show.
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>
Fudge
</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta http-equiv="Content-Language-Type" content="en-GB">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
</head>
<body>
<div style="display:table;width:100%;border:solid thin #000000;">
<div style="display:table-cell;background-color:blue;color:white;width:128px;height:128px;border-right:#ff0000 solid thin;">
<div style="text-align:center;">sss</div>
</div>
<div style="display:table-cell;">
<div style="text-align:center;">Title</div>
</div>
</div>
<br>
<div style="display:table;border:thin #000000 solid;padding:3px;">
<div style="display:table-row;border:thin #000000 solid;">
<div style="display:table-cell;border:thin blue solid;">one</div>
<div style="display:table-cell">two</div>
<div style="display:table-cell">three</div>
</div>
<div style="display:table-row;">
<div style="display:table-cell;">four</div>
</div>
<div style="display:table-row;">
<div style="display:table-cell;">five, and some more text</div>
</div>
</div>
<p>
Hello world.
</p>
</body>
</html>
Steve