HTML Table attributes and elements

Table Tag:
The <table> tag defines an HTML table.
An HTML table consists of the <table> element and one or more <tr><th>, and <td> elements.
The <tr> element defines a table row, the <th> element defines a table header, and the <td> element defines a table cell.

COLSPAN AND ROWSPAN:

Creating a cell that “spans” across a number of columns or rows is possible using the COLSPAN and the ROWSPAN properties in a TD (or TH) tag.
These two properties can be a bit confusing, so I’ll start off with a simple 2 row 2 column table.

<table>
<tr>
<td>
row 1 cell 1
</td>
<td>
row 1 cell 2
</td>
</tr>
<tr>
<td>
row 2 cell 1
</td>
<td>
row 2 cell 2
</td>
</tr>
</table>
row 1 cell 1. row 1 cell 2
row 2 cell 1 row 2 cell 2

COLSPAN creates a cell that “spans” across a number of cells in a row. This makes the cell longer across, not down, since it is crossing COLumns, not ROWs.

<table>
<tr>
<td>
row 1 cell 1
</td>
<td>
row 1 cell 2
</td>
</tr>
<tr>
<td colspan=”2>
row 2 cell 1
</td>
</tr>
</table>
row 1 cell 1. row 1 cell 2
row 2 cell 1

ROWSPAN is very similar to COLSPAN, but it works in the opposite direction. While COLSPAN goes across columns, ROWSPAN goes across rows. Taking the simple 2 row 2 column table from above, here is an example with ROWSPAN in place.

<table>
<tr>
<td rowspan=”2>
row 1 cell 1
</td>
<td>
row 1 cell 2
</td>
</tr>
<tr>
<td>
row 2 cell 2
</td>
</tr>
</table>
row 1 cell 1 row 1 cell 2
row 2 cell 2

CELLSPACING:

It is a attribute of Table tag. We use cellspacing attribute to set the space among the cells of table.

CELLPADING:
It is also a attribute of Table tag. We use it to set the space between cell wall and cell text.

Note : There are also  many attribute of table tag like border, BGcolor(background color),Frame ,rules ,width etc.

Example:

<TABLE BORDER=1 CELLPADDING=2 CELLSPACING=3>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</TABLE>

DIV Tag:

The <div> tag is nothing more than a container unit that encapsulates other page elements and divides the HTML document into sections. Web developers use <div> elements to group together HTML elements and apply CSS styles to many elements at once. For instance, by wrapping a set of paragraph elements into a <div> element, the developer can take advantage of CSS styles and apply a font to all paragraphs at once by applying a font style to the <div> tag instead of coding the same style for each paragraph elements.

 Example:

<div id="myDiv" name="myDiv" title="Example Div Element">
  <h5>Subtitle</h5>
  <p>This paragraph would be your content paragraph...</p>
  <p>Here's another content article right here.</p>
</div>

 

Library Management System

Introduction:

This article is about managing complete record of book and students who issue book from a library and can generate report in RDLC or excel about the required record.

Tools:

  • Visual Studio 2010
  • Language: C#
  • SQL Server 2008 R2

Background:

This library management system is been completely made dynamically except main page that  gives option of three buttons Student that gives option to have a detail look of student , Book that give complete record of issued and total number of books you have in the library while Generate Report  give the report in Excel of required data on need basis.

The Library Management System:

The main form has three buttons on it mentioned below

Untitled

Student button give the options of Updating, Deleting, Inserting and searching a specific record. If we click on the Student Button another form would be opened displaying four different options to handle the record.

1

On clicking these options other forms would be opened that help in inserting or performing specific task related to the required button. If we click on the insert button another form would be opened to help inserting a new record of student.

Capture

In this you have to fill all the required fields and after clicking on insert button the record will be successfully stored in the database.
If user want to search a particular record he has to click on the search button then a form will be displayed.

2 (2)

In this user have to enter the specific student name whose  information you want to see in this case we didn’t used the student id because sometimes student id is not available.
If user wants to delete a particular record he has to click on the delete button. Then a form will be displayed.

1 (2)

In this user enter the student id and after clicking on the delete button the record correspondent to that id would be successfully deleted.
If user wants to update a particular record he clicked on the update button and a form will be displayed showing particular fields you want to update.

3

In this user can fill desired fields he wants to update and click on the update button this will overwrite the previous record with the new record in this student id is compulsory as the id identifies the difference between all records.
The same features are available if you click on the book button and if you click on the report viewer it would ask for which report you want to see and on clicking the particular button all record will be displayed in a presentable way.

Code:

To add a form dynamically

Form  f1 = new Form();
Now you can open that form by writing
f1.open();
and you can close it by writing
f1.close();

To add buttons on the form you added dynamically

Button a = new Button();
f2.Controls.Add(a);
//it will add the button to the  form
a.Location = new System.Drawing.Point(80, 20);
//this is to set the location of the button you want to be displayed on the form
a.Text = “Insert”;
//it’s the button name you want to add e.g insert is the name of the button
a.Click += new EventHandler(this.insert_student_Click);
//this will open the specified action you want to perform on clicking that     button
e.g it will open the function named as this.insert_student_Click
In the same way you can add textbox, labels or buttons on the form dynamically.In

In case you want to insert a new record:

We will enter all record and then save that record in database the specific code of saving that record using vs is as follow.

//t1 is the textbox parallel to student id and vice versa
int a = Convert.ToInt32(t1.Text);
string b = t2.Text;
int c = Convert.ToInt32(t3.Text);
string d = t4.Text;
int ef = Convert.ToInt32(t5.Text);
string g = t6.Text;
Insert_Student(a, b, c, d, ef, g);
f1.Close();

after storing textbox texts in particular fields we call procedure  using specific record.

public void Insert_Student(int Std_id, String Name, int age, String course, int semes, String session)
{

SqlConnection sqc = new SqlConnection(@”Data Source=AMNA-PC\SQLEXPRESS; Init  ial Catalog=Library ;Integrated Security=True;”);
SqlCommand objcom1 = new SqlCommand(“Insert_Student”, sqc);
objcom1.CommandType = CommandType.StoredProcedure;
objcom1.Parameters.Add(“@studnt_id”, SqlDbType.Int).Value = Std_id;
objcom1.Parameters.Add(“@Name”, SqlDbType.NChar).Value = Name;
objcom1.Parameters.Add(“@age”, SqlDbType.Int).Value = age;
objcom1.Parameters.Add(“@course”, SqlDbType.NChar).Value = course;
objcom1.Parameters.Add(“@semes”, SqlDbType.Int).Value = semes;
objcom1.Parameters.Add(“@session”, SqlDbType.NChar).Value = session;
SqlDataAdapter objadap = new SqlDataAdapter(objcom1);
objadap.Fill(ds);

}

Queries:

  • Insert statements for procedure here

Insert into Student(Student_id,Name ,Age ,Course,Semester,Session) Values (@studnt_id ,@Name,@age,@course,@semes ,@session);

  • delete statements for procedure here

Delete from Student where Student_id = @Student_id
Delete from Issued_Book_Record where Student_id = @Student_id

  • update statements for procedure here

set Student_id = @studnt_id ,Name=@Name, Age=@age, Course=@course,    Semester=@semes,Session=@session where Student_id = @studnt_id

  • search statements for procedure here

SELECT Student_id,Name,Age,Course,Semester,Session from Student where Name = @Name
other queries are vice versa

Library Management System
by Hina Aziz

Web Folder and Web Application

Web Folder:

Provides an interface for managing files on a remote Web server. Web folders provide document storage and publishing functionality.

A Web directory /web folder organizes Web sites by subject, and is usually maintained by humans instead of software. The searcher looks at sites organized in a series of categories and menus. These collections of links are usually much smaller than search engines’ databases, since the sites are looked at by human eyes instead of by spiders.

There are two ways for sites to be included in a Web directory’s listings; either the site owner can submit the site by hand, or the directory’s editor(s) will eventually come across that site.

 Web Application:

A web application is any application that uses a web browser as a client.A virtual server that resides on an HTTP server but appears to the user as a separate HTTP server. Several Web applications can reside on one computer, each capable of running its own programs and each having individualized access to input and peripheral devices. Each Web application can have its own domain name and IP address.

Web applications commonly use a combination of server-side script (ASP, PHP, etc) and client-side script (HTML, Javascript, etc.) to develop the application. The client-side script deals with the presentation of the information while the server-side script deals with all the hard stuff like storing and retrieving the information.

Most web applications are based on the client-server architecture where the client enters information while the server stores and retrieves information. Internet mail is an example of this, with companies like Yahoo and MSN offering web-based email clients.

Create a Web Application (IIS):

1-Open IIS Manager. For information about opening IIS Manager from administrative tools.

a-

Untitled

b-

1

2-In the Connections pane, expand the Sites node.

2

3-Right-click the site for which you want to create an application, and click Add Application.

3

This window will appear after click on that :

4

  • In the Alias text box, type a value for the application URL, such as marketing. This value is used to access the application in a URL.
  • Click Select if you want to select a different application pool than the one listed in the Application pool box. In the Select Application Pool dialog box, select an application pool from the Application pool list and then click OK.
  • In the Physical path text box, type the physical path of the application’s folder, or click the browse button () to navigate the file system to find the folder.
  • Click OK.