Table Control in ASP.NET
Table Control in ASP.NET
M.SARULATHAAssistant ProfessorDept. of CA,JJC.
ASP.NET table server management displays
a table on a web page. It is a NET web administrator so we can configure it
with server code such as inserting, deleting table row, cell system. TableRow
and TableCell server controls allow us to display Table contents. Table server
management displays table data and we can format table server management using
methods and structures. The main difference between an HTML table and an
asp.net table server management is that we can use table server management
using an object model. We usually have to use table server controls when we
intend to add system rows and cells (columns) by default during startup.
Table server management acts as a parent
(container) for TableRows controls. The property of the control lines table is
a collection of TableRow items. Each TableRow control has a collection called
Cells. Cell collection contains TableCell items.
Actually the table server control
displays the contents of TableCell controls. TableCell layout value control
that stores HTML text text. you can add and display controls within the Table
cell.
The table has many features to control
its appearance such as BackColor, ForeColor, BorderColor, BorderWidth,
BorderStyle, Height, BackImageUrl, Caption, CellPadding, CellSpacing, CssClass,
GridLines, Font, HorizontalAlign, Style, SkinID and Stable etc. . Or we can
change any cell look or individual line and look.
Table server management can display data
from the database. But table control does not provide any assets that we can
use to directly display data. The following example code C # explains more
about ASP.NET Table server control.
<%@ Page Language="C#"
%>
<!DOCTYPE html>
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>How to use Table in
asp.net</title>
</head>
<body style="padding:25px">
<form id="form1" runat="server">
<div>
<h2 style="color:MidnightBlue;
font-style:italic;">
How to use Table in asp.net
</h2>
<hr width="450" align="left" color="Gainsboro"
/>
<asp:Table ID="Table1"
runat="server"
Font-Size="X-Large"
Width="550"
Font-Names="Palatino"
BackColor="Orange"
BorderColor="DarkRed"
BorderWidth="2"
ForeColor="Snow"
CellPadding="5"
CellSpacing="5"
>
<asp:TableHeaderRow
runat="server"
ForeColor="Snow"
BackColor="OliveDrab"
Font-Bold="true"
>
<asp:TableHeaderCell>Serial</asp:TableHeaderCell>
<asp:TableHeaderCell>Name</asp:TableHeaderCell>
<asp:TableHeaderCell>Value</asp:TableHeaderCell>
</asp:TableHeaderRow>
<asp:TableRow
ID="TableRow1"
runat="server"
BackColor="OrangeRed"
>
<asp:TableCell>1</asp:TableCell>
<asp:TableCell>Azure</asp:TableCell>
<asp:TableCell>#F0FFFF</asp:TableCell>
</asp:TableRow>
<asp:TableRow
ID="TableRow2"
runat="server"
BackColor="DarkOrange"
>
<asp:TableCell>2</asp:TableCell>
<asp:TableCell>Beige</asp:TableCell>
<asp:TableCell>#F5F5DC</asp:TableCell>
</asp:TableRow>
<asp:TableRow
ID="TableRow3"
runat="server"
BackColor="OrangeRed"
>
<asp:TableCell>3</asp:TableCell>
<asp:TableCell>Bisque</asp:TableCell>
<asp:TableCell>#FFE4C4</asp:TableCell>
</asp:TableRow>
<asp:TableRow
ID="TableRow4"
runat="server"
BackColor="DarkOrange"
>
<asp:TableCell>4</asp:TableCell>
<asp:TableCell>Crimson</asp:TableCell>
<asp:TableCell>#DC143C</asp:TableCell>
</asp:TableRow>
<asp:TableRow
ID="TableRow5"
runat="server"
BackColor="OrangeRed"
>
<asp:TableCell>5</asp:TableCell>
<asp:TableCell>Cyan</asp:TableCell>
<asp:TableCell>#00FFFF</asp:TableCell>
</asp:TableRow>
<asp:TableFooterRow
runat="server"
BackColor="DarkOrange"
>
<asp:TableCell
ColumnSpan="3"
HorizontalAlign="Right"
Font-Italic="true"
>
Number of colors 5
</asp:TableCell>
</asp:TableFooterRow>
</asp:Table>
</div>
</form>
</body>
</html>
Comments
Post a Comment