Page 1 of 1

Table grid with css

Posted: Mon Feb 02, 2009 8:41 pm
by parthasarker
Hello Friends,

We always use table for grid at html pages. Recently I was working on a page where I needed a grid with three column and 5 rows.. where I had to use <ul>, <li> and <div> for designing...

Image

I completed the project with the following way.. I hope it is OK and will help someone for this type solutions...

HTML page code
---------------------------------------------------------
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test grid design</title>
<style type="text/css">
<!--
@import url("main.css");
-->
</style>
</head>
<body>
<div id="left">
<ul id="pages">
<li>
<div class="divstyle">This is Div1</div>
<div class="divstyle">This is Div2</div>
<div class="divstyle">This is Div3</div>
</li>
<li>
<div class="divstyle">This is Div1</div>
<div class="divstyle">This is Div2</div>
<div class="divstyle">This is Div3</div>
</li>
<li>
<div class="divstyle">This is Div1</div>
<div class="divstyle">This is Div2</div>
<div class="divstyle">This is Div3</div>
</li>
<li>
<div class="divstyle">This is Div1</div>
<div class="divstyle">This is Div2</div>
<div class="divstyle">This is Div3</div>
</li>
<li>
<div class="divstyle">This is Div1</div>
<div class="divstyle">This is Div2</div>
<div class="divstyle">This is Div3</div>
</li>
</ul>
</div>
</body>
</html>
----------------------------------------------

CSS style code
-----------------------------------------------
#left{
width:460px;
}
#left #pages{
padding:0px;
margin:0px;
list-style:none;
}
#left #pages li{
padding:0;
margin:0;
text-align:left;
margin-bottom:1px;
}
#left #pages div{
float:left;
width:140px;
padding:0 5px;
border:1px solid #cccccc;
height:25px;
line-height:25px;
background-color:#f5f5f5;
color:#000000;
text-decoration:none;
}
---------------------------------------

I just sharing my knowledge and findings, though I know many of you completed this type solution before.

Thanks

Re: Table grid with css

Posted: Mon Feb 02, 2009 8:53 pm
by pagol
thanks parthasarker .... onek e ata kajey lagbey... asha kori

Re: Table grid with css

Posted: Mon Feb 02, 2009 9:31 pm
by Tashlima
hey this one is simple and easier .. long time ago i also made such table using CSS but dont remember how .. anyways thanks for sharing.

Re: Table grid with css

Posted: Mon Feb 02, 2009 9:40 pm
by asifshahid
amar moto manusher kaje lagbe :D thanks partha bhai....

Re: Table grid with css

Posted: Mon Feb 02, 2009 10:07 pm
by sweetafroza
thanks partha bhai... eta amaroo kaje lagbe.. ----

Re: Table grid with css

Posted: Tue Feb 03, 2009 5:36 am
by sislamrony
Bojhar Onek chesta korlam.10% bujhte parchi.Baki 90% DD te member thaika bujhte hobe.

Re: Table grid with css

Posted: Tue Feb 03, 2009 5:38 am
by sweetafroza
hehehehehe... :) try kore jan rony bhai... its very simple :p

Re: Table grid with css

Posted: Tue Feb 03, 2009 5:45 am
by sislamrony
Sobkichu ki r akdin a hoi apa. Man is mortal-Manush matro vul hoi.Tai onekdin lage.he he he

Re: Table grid with css

Posted: Tue Feb 03, 2009 9:15 am
by mony
css er oi deep e khokhono think kori nai... ar proyozon o pore nai..shotti bolte... peye balo laglo.....:D
tnx..partha da