Admittedly, I'm new to CSS but I am having some difficulty converting tables to CSS. Here is a CSS example for a simple 4 cell table that works fine -- but only without the DOCTYPE declaration (any DOCTYPE declaration)!
Does anyone know what, if anything, I am doing wrong ? Any help would be appreciated.
(Also I would like to see any successful examples anyone would like to post.)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
.TblContainer {
width:400px;
font-family:Arial,Helvetica,sans-serif;
background-color:yellow;
border:1px solid #CCCCCC;
margin:3px 3px 3px 3px;
}
.Row {
margin:3px 3px 3px 3px;
}
.Cell {
color:#000000;
border:1px solid #CCCCCC;
float:left;
font-size:16px;
text-align:center;
width:49%;
}
</style>
</head>
<body>
<div class="TblContainer">
<div class="Row">
<div class="Cell">Cell 1</div>
<div class="Cell">Cell 2</div>
</div>
<div class="Row">
<div class="Cell">Cell 3</div>
<div class="Cell">Cell 4</div>
</div>
</div>
</body>
</html>