Saturday, February 18, 2012

Stylish table using CSS



Copy and paste the following code to generate stylish table using CSS in ASP.Net



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="csstest.aspx.cs" Inherits="csstest" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
   
<style type="text/css">
table,th,td
{
    border:2px solid black;
}
</style>
   
</head>
<body>
    <form id="form1" runat="server">
    <div>
     
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>sourav</td>
<td>Kayal</td>
</tr>
<tr>
<td>abc</td>
<td>bbbb</td>
</tr>

<tr>
<td>abc</td>
<td>bbbb</td>
</tr>
</table>

    </div>
    </form>
</body>
</html>

No comments:

Post a Comment