Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 02, 2012 09:21 AM by kharearchana
0 Points
49 Posts
May 01, 2012 08:47 AM|LINK
I want to create a table using DIV tag. My code is following:
<style type="text/css"> .divtable { display:table; } .divrow { display:table-row; } .divcol { display:table-column Float:; } </style> <title></title> </head> <body> <form id="form1" runat="server"> <div class="divtable"> <div class="headrow"> <div class="divcol">Cust_no</div> <div class="divcol">Name</div> <div class="divcol">address</div> </div> <div class="divrow"> <div class="divcol">001</div> <div class="divcol">poonam</div> <div class="divcol">ashok vihar</div> </div> <div class="divrow"> <div class="divcol">002</div> <div class="divcol">reena</div> <div class="divcol">preet vihar</div> </div> </div> </form> </body> </html>
output is coming like this
Member
212 Points
51 Posts
May 01, 2012 08:49 AM|LINK
check this link this may help you out
http://www.webmasterworld.com/html/4065001.htm
All-Star
43040 Points
7032 Posts
MVP
May 01, 2012 01:49 PM|LINK
Hello,
I formatted your code a bit. Look at it. :)
<html> <head> <style type="text/css"> div { border:1px solid; } .divtable { display:table; } .divrow { display:table-row; } .divcol { display:table-cell; width:100px; } .headrow { display:table-caption; } .content { display:table-cell; width:100px; } </style> <title></title> </head> <body> <form id="form1" runat="server"> <div class="divtable"> <div class="headrow"> <div class="divcol">Cust_no</div> <div class="divcol">Name</div> <div class="divcol">address</div> </div> <div class="divrow"> <div class="content">001</div> <div class="content">poonam</div> <div class="content">ashok vihar</div> </div> <div class="divrow"> <div class="content">002</div> <div class="content">reena</div> <div class="content">preet vihar</div> </div> </div> </form> </body> </html>
Please 'Mark as Answer' if this post helps you.
651 Points
210 Posts
May 01, 2012 10:27 PM|LINK
You might also look at http://960.gs for a great method of laying out your screen via a grid system.
30184 Points
4906 Posts
May 02, 2012 07:19 AM|LINK
Hi,
Try these post-
http://www.codeproject.com/Articles/47934/DIV-TABLE
http://beta.blogs.microsoft.co.il/blogs/oric/archive/2011/12/24/implement-an-html-table-using-div-only.aspx
May 02, 2012 09:21 AM|LINK
Thanks. your code is working. I have to do just small changes at one or two places.
kharearchana
0 Points
49 Posts
how to create a table using DIV tag
May 01, 2012 08:47 AM|LINK
I want to create a table using DIV tag. My code is following:
<style type="text/css">
.divtable
{
display:table;
}
.divrow
{
display:table-row;
}
.divcol
{
display:table-column
Float:;
}
</style>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div class="divtable">
<div class="headrow">
<div class="divcol">Cust_no</div>
<div class="divcol">Name</div>
<div class="divcol">address</div>
</div>
<div class="divrow">
<div class="divcol">001</div>
<div class="divcol">poonam</div>
<div class="divcol">ashok vihar</div>
</div>
<div class="divrow">
<div class="divcol">002</div>
<div class="divcol">reena</div>
<div class="divcol">preet vihar</div>
</div>
</div>
</form>
</body>
</html>
output is coming like this
<form id="form1"> <div class="divtable"> <div class="headrow"> <div class="divcol">Cust_no</div> <div class="divcol">Name</div> <div class="divcol">address</div> </div> <div class="divrow"> <div class="divcol">001</div> <div class="divcol">poonam</div> <div class="divcol">ashok vihar</div> </div> <div class="divrow"> <div class="divcol">002</div> <div class="divcol">reena</div> <div class="divcol">preet vihar</div> </div> <div class="divcol"></div> <div class="divcol">Every value is coming in only one column not in different column. Can somebody correct my code.</div> </div> <div class="divcol"></div> <div class="divcol">thanks.</div> </form>chiragtoad
Member
212 Points
51 Posts
Re: how to create a table using DIV tag
May 01, 2012 08:49 AM|LINK
check this link this may help you out
http://www.webmasterworld.com/html/4065001.htm
Ruchira
All-Star
43040 Points
7032 Posts
MVP
Re: how to create a table using DIV tag
May 01, 2012 01:49 PM|LINK
Hello,
I formatted your code a bit. Look at it. :)
<html> <head> <style type="text/css"> div { border:1px solid; } .divtable { display:table; } .divrow { display:table-row; } .divcol { display:table-cell; width:100px; } .headrow { display:table-caption; } .content { display:table-cell; width:100px; } </style> <title></title> </head> <body> <form id="form1" runat="server"> <div class="divtable"> <div class="headrow"> <div class="divcol">Cust_no</div> <div class="divcol">Name</div> <div class="divcol">address</div> </div> <div class="divrow"> <div class="content">001</div> <div class="content">poonam</div> <div class="content">ashok vihar</div> </div> <div class="divrow"> <div class="content">002</div> <div class="content">reena</div> <div class="content">preet vihar</div> </div> </div> </form> </body> </html>
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.cyoung311
Member
651 Points
210 Posts
Re: how to create a table using DIV tag
May 01, 2012 10:27 PM|LINK
You might also look at http://960.gs for a great method of laying out your screen via a grid system.
Nullum gratuitum prandium
asteranup
All-Star
30184 Points
4906 Posts
Re: how to create a table using DIV tag
May 02, 2012 07:19 AM|LINK
Hi,
Try these post-
http://www.codeproject.com/Articles/47934/DIV-TABLE
http://beta.blogs.microsoft.co.il/blogs/oric/archive/2011/12/24/implement-an-html-table-using-div-only.aspx
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog
kharearchana
0 Points
49 Posts
Re: how to create a table using DIV tag
May 02, 2012 09:21 AM|LINK
Thanks. your code is working. I have to do just small changes at one or two places.