This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Monday, 22 April 2013

HTML Table tag



HTML  Table tag


  • The HTML table element inserts a table in the document. 
  • Tables are a very useful and powerful feature of the HTML language, as they give a solution for inserting any type of tabulated data in the document.
  • This element is the main container of a table, but many other elements are needed to define a table correctly. Other elements that constitute a table are:

  • Rows (HTML tr element)
  •   Cells (HTML td element)
  •   Header cells (HTML th element)
  •   Caption or title (HTML caption element)
  • An HTML table can be basically considered as a set of rows containg cells and not backwards.

A table can be divided horizontally, defining these sections:
  • Header (HTML thead element)
  • Body or bodies (HTML tbody element)
  • Footer (HTML tfoot element)

  • Tables consist of the <table> element as well as other table-related elements.
  •  These other elements are nested inside the <table> tags to determine how the table is constructed.



Decription

  • An HTML table is an element comprised of table rows and columns, much like you'd see when working with an application such as Excel.
  • Tables are container elements, and their sole purpose is to house other HTML elements and arrange them in a tabular fashion -- row by row, column by column.
  • Tables may seem difficult at first, but after working through this lesson, you'll see that they aren't so horrible.

 A table element consists of three different HTML tags including the <table> tag, <tr> (table rows), and the <td> (table columns) tags.

Attributes:>>>

1) id (name)

The "id" attribute assigns an identifier to the associated element.
This identifier must be unique in the document and can be used to refer to that element in other instances (e.g., from client-side scripts).

2) class (cdata)

The "class" attribute assigns a class name (or a list of class names separated by spaces) to the container element.
 It's used together with style sheets and tells the browser the class (or classes) to which the element is associated with.

3) style (style)

This attribute is used to define presentational attributes for the containing element, and its value should be composed by style sheets properties.
Although, in some cases, it can become useful, a better practice is to place presentational attributes in external files, relating them to elements with the "class" attribute.
This way you keep the semantic and presentational parts of your document separated.

4) title (text)

The purpose of this attribute is to provide a title for the element.
Its value must be a short and accurate description of the element.
 Browsers usually render it as a "tool tip" when the user puts the mouse pointer over the element for a small period of time.

5) lang (langcode)

Specifies the language of an element's content. The default value in "unknown".


This attribute indicates the direction in which the texts of the element must be read.

This includes content, attribute values and tables. It has two possible values that are case-insensitive:
  • RTL: Right to left.
  • LTR: Left to right.

7) border (pixels)

Defines the width of the border of a table as a number of pixels.

8)cellpadding (length)

Defines the width of the space to be left between a cell's content and its border.


9) align

This attribute has been deprecated in HTML 4.01. Therefore its use is no longer recommended.
It decides the horizontal alignment of the table. Possible values (case-insensitive) are:
  • left: The table is aligned to the left margin.
  • right: The table is aligned to the right margin.
  • center: The table is centered.

Example
<html>
<body>
<table summary="Representation of how the pages of the website work in different versions of Internet Explorer and Mozilla firefox">
<caption>Compatibility of the website in IE and FF</caption>
<colgroup></colgroup>
<colgroup span="3"></colgroup>
<colgroup span="2"></colgroup>
<thead>
<tr>
<th scope="row">Browser</th>
<th scope="col" colspan="3">Internet Explorer</th>
<th scope="col" colspan="2">Mozilla Firefox</th>
</tr>
<tr>
<th scope="col">Name</th>
<th scope="col">4.0</th>
<th scope="col">5.0</th>
<th scope="col">6.0</th>
<th scope="col">2.0</th>
<th scope="col">3.0</th>
</tr>
</thead>
<tbody>
<tr>
<td>index.html</td>
<td>Ok</td>
<td>Ok</td>
<td rowspan="4">Ok</td>
<td>Ok</td>
<td rowspan="4">Ok</td>
</tr>
<tr>
<td>fullfunc.html</td>
<td>Bad</td>
<td>Partial</td>
<td>Partial</td>
</tr>
<tr>
<td>nofunc.html</td>
<td>Ok</td>
<td>Ok</td>
<td>Ok</td>
</tr>
<tr>
<td>panel.html</td>
<td>Bad</td>
<td>Partial</td>
<td>Partial</td>
</tr>
</tbody>
</table>
</body>
</html>


HTML Forms



HTML Forms

  • HTML forms are used to pass data to a server.
  • An HTML form can contain input elements like text fields, checkboxes, radio-buttons, submit buttons and more.
  •  A form can also contain select lists, textarea, fieldset, legend, and label elements.

         The <form> tag is used to create an HTML form:
               <form>
                 .
                 input elements
                .
              </form>


  • The most important form element is the <input> element.
  • The <input> element is used to select user information.
  • An <input> element can vary in many ways, depending on the type attribute. An <input> element can be of type text field, checkbox, password, radio button, submit button, and more.
  • HTML forms are placed on a web page using the <form> tag.
  • This tag should encapsulate a series of other form elements, identifying them as a single cohesive web form.


Description


  • HTML web forms are a composition of buttons, checkboxes, and text input fields embedded inside of HTML documents with one goal in mind: to capture user input.
  • By doing things such as providing fields for user data such as names, phone number, and email addresses, web forms give users the opportunity to interact directly with a webpage.
  • HTML form elements rely on action and method attributes to identify where to send the form data for processing (action) and how to process the data (method).
  • In the code above, we've inserted some make-believe values to represent what a typical HTML form might look like behind the scenes.
  • Forms are usually combined with programs written in various programming languages to allow developers to create dynamic web sites.
  • The most popular languages include both client-side and/or server-side languages.
  • Although any programming language can be used on the server to process a form's data, the most commonly used languages are scripting languages, which tend to have stronger string handling functionality than programming languages such as C, and also have automatic memory management which helps to prevent buffer overrun attacks.


Example

<!DOCTYPE html>
<html>
<body>

<form action="">

<legend>Personal information:</legend>
Name: <input type="text" size="30"><br>
E-mail: <input type="text" size="30"><br>
Date of birth: <input type="text" size="10">

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


Display

Personal information:
 Name:
E-mail:
Date of birth:
VBottom of Form


HTML List



HTML LIST


  • HTML offers authors several mechanisms for specifying lists of information. 
  • All lists must contain one or more list elements. Lists may contain:

  • Unordered information.
  • Ordered information.
  • Definitions.

HTML LIST Description


  • HTML Unordered Lists

An unordered list (<ul>) signifies to a web browser that all list items contained inside the <ul> tag should be rendered with a bullet preceding the text. 
The default bullet type for most web browsers is a full disc (black circle), but this can be adjusted using an HTML attribute called type.

  • HTML Ordered Lists

An ordered list is defined using the <ol> tag, and list items placed inside of an ordered list are preceded with numbers instead of bullets.


  • HTML Definition Lists

HTML definition lists (<dl>) are list elements that have a unique array of tags and elements; the resulting listings are similar to those you'd see in a dictionary.
<dl> - opening clause that defines the start of the list
<dt> - list item that defines the definition term
<dd> - definition of the list item

Use of HTML LIST


  • Use Of HTML Lists In Web Design. 
  • These include navigation menus, profile links, archives, tasks/checklists, and tons of other uses!



Example of HTML LIST

Unordered List:
      
       Code:

              <ul>
<li>Apples</li>
<li>Oranges</li>
<li>Bananas</li>
</ul>

        Result:
·         Apples
·         Oranges
·         Bananas



Ordered List:

       Code:

              <ol>
<li>Apples</li>
<li>Oranges</li>
<li>Bananas</li>
</ol>

Result:
1.   Apples
2.   Oranges
3.   Bananas



Definition List:
      
       Code:

              <dl>
                   <dt><b>Fromage</b></dt>
                    <dd>French word for cheese.</dd>
                   <dt><b>Voiture</b></dt>
                    <dd>French word for car.</dd>
                   </dt>
</dl>

Result:

       Fromage
French word for cheese.
Voiture
French word for car.


Twitter Delicious Facebook Digg Stumbleupon Favorites More