Hi
I want to create table based structure but without using table tag. I want to use div tag. How can I do that?
I want to create table based structure but without using table tag. I want to use div tag. How can I do that?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS 'equal columns'</title>
<style>
.containdiv {
width: 100%;
display: block;
border: 1px solid #000;
background: #afa;
}
.col {
padding: 1em;
}
.col1 {
float: left;
width: 200px;
}
.col2 {
display: block;
top: 0;
margin-left: 220px;
margin-right: 230px;
}
.col3 {
width: 200px;
position: absolute;
right: 0;
top: 0;
}
.ftr SPAN, .hdr SPAN {
display: block;
padding: 0.5em;
}
.hdr {
border-left: 1px solid #000;
border-top: 1px solid #000;
background: #ffa;
}
.ftr {
border-left: 1px solid #000;
border-bottom: 1px solid #000;
border-top: none;
clear: left;
background: #ffa;
}
</style>
</head>
<body>
<div class="containdiv">
<div class="hdr">
<span style="text-align:center;">Header</span>
</div>
<div style="position:relative;width:100%;">
<span class="col col1">some text</span>
<span class="col col2"> In the second Oration, delivered next day, he dwells on the Sacrament of Baptism and its spiritual effects; and takes occasion to reprove the then still prevalent practice of deferring Baptism till the near approach of death. He likewise dwells on the truth that the validity and spiritual effect of the Sacrament is wholly independent of the rank or worthiness of the Priest who may minister it
</span>
<span class="col col3">some text</span>
</div>
<div class="ftr">
<span style="text-align:center;clear:both;">Footer</span>
</div>
</div>
</body>
</html>
.containdiv {
width: 100%;
display: block;
border: 1px solid #000;
}
.col {
padding: 1em;
display: table-cell;
}
.col1 {
width: 10%;
background: #dde;
}
.col2 {
background: #ede;
}
.col3 {
width: 10%;
background: #edd;
}
Comment