Wednesday 28 August 2013

                   In  this post we are going to discuss how to create  TABLE and  FRAME
TABLES:
                   *This TABLE tag defines a table.
                   *Inside the TABLE tag, use the TR tag to define rows in the table.
                   *Use the TH tag to define row or column headings
* Use the TD tag to define table cells.
                   *Width of the border surrounding the table and default background color of the table.
                   *CELLSPACING – attribute to specify the distance between cells in the table.
                   *CELLPADDING - attribute to specify the distance between the border and content of every cell
                   Syntax:
                             <TABLE
ALIGN=”LEFT|RIGHT”   BGCOLOR= ”color ”  BORDER=”value”  CELLPADDING=”value” CELLSPACING=”value”  HEIGHT=”height”  WIDTH=”width”  COLS=”numofcols”  HSPACE=”horizMargin”  VSPACE=”vertMargin”>
………. </TABLE>
          FOR EXAMPLE:
                             <HTML>   
<CENTER>                  
<TABLE BORDER=”1” WIDTH="300">
<COLGROUP ALIGN="CENTER" WIDTH="80"/>
<COLGROUP SPAN="2"/>
<COL ALIGN="RIGHT" WIDTH="80" />
<COL ALIGN="RIGHT" WIDTH="80" />         
<THEAD><TR>
<TH  COLSPAN="3"> INFORMATION</TH>
</TR>
<TR></THEAD>
<TFOOT><TR>
<TD COLSPAN="3"> FOOTER OF THE  TABLE</TD></TFOOT>
                             <TR>
                             <TH  COLSPAN="3"> INFORMATION</TH>
                             </TR>
                             <TR>
<TH>Name</TH>
                             <TH>Age</TH>
                             <TH>Percentage</TH>
                             </TR>
                            
<TR>
<TD>Raj</TD>
<TD>21</TD>
<TD>80</TD>
</TR>

<TR>
<TD>Ram</TD>
<TD>23</TD>
<TD>60</TD>
</TR>

<TR>
<TD>Kavi</TD>
<TD>21</TD>
<TD>90</TD>
</TR>
</TABLE></CENTER>
</HTML>
                             *<THEAD> <TBODY>and <TFOOT > elements can also be used
FRAMESET(SET OF FRAMES)
                             *FRAMESET tag defines a set of frames that appear in a web browser window.
                             *Frames are created with the combination of two elements:
                                                =><FRAMESET>
                                                =><FRAME>
                             *The <FRAME> element uses scr attribute to specify the URL of the file to display.
Creating Frames:
Syntax
          <FRAMESET
COLS=”columnwidthlist”
ROWS=”rowheightlist”
BORDER=”pixwidth”
BORDERCOLOR=”color”
FRAMEBORDER=”YES|NO”
> 
</FRAMESET>
                  * COLS and ROWS can * value.
                             *An asterisk (*), which means “as much space as possbile”. The total available left-over space is divided equally between all rows that use an asterisk.
For Example:
          <HTML>
          <HEAD>
<TITLE>FRAMES EXAMPLE</TITLE>
</HEAD>
<FRAMESET COLS=”50”,”50”>
<FRAME SRC=”FRAME1.HTML”/>
<FRAME SRC=”FRAME2.HTML”/>
</FRAMESET>
</HTML>
Where FRAME1.HTML document is
                   <HTML>
                   <HEAD>
<TITLE>FRAME1 EXAMPLE</TITLE>
</HEAD>
<BODY BGCOLOR=”BLACK” TEXT=”WHITE”>
<H1>FRAME ONE</H1>
</BODY>
</HTML>
And FRAME2.HTML document is         
<HTML>
                   <HEAD>
<TITLE>FRAME2 EXAMPLE</TITLE>
</HEAD>
<BODY BGCOLOR=”WHITE” TEXT=”BLACK”>
<H1>FRAME TWO</H1>
<P><A HREF="http://www.google.com">GOOGLE</A></P>
<P><A HREF="http://www.yahoo.com">YAHOO</A></P>
<P><A HREF="http://www.rediff.com">REDIFF</A></P>
</BODY>
</HTML>  
FORMS:
          *Used to create a HTML form.
          *It contains interface elements such as text fields, buttons, checkboxes, radio buttons and selection lists that let user enter text and make choices.
          *All elements must be defined between <FORM> and </FORM> tags.
          *Each interface element in the form must be defined within an appropriate tag such as <INPUT> or <SELECTION>.
          *TYPE attribute is used to indicate the type of element within the input tag such as button , checkbox and so on.
          SUBMIT BUTTON:
                   To enable the form to process the data that the user enters, it must have a “SUBMIT” button
                   <input type=”submit”> tag
                   The action invoked is defined by the ACTION attribute or the FORM tag. The value of the ACTION attribute is a URL that points to a CGI program.
                   A CGI program runs on the server, processes argument sent by the form and returns data to the browser.
                   The value of the form’s METHOD attribute also affects the way CGI program is invoked.
SYNTAX
<FORM
ACTION=”serverURL”
METHOD=”GET|POST”
NAME=”forName”
> 
..
</FORM>
          GET(the default) appends the input information to the URL which on the most receiving systems becomes the value of the environment variable QUERY_STRING..
          POST sends the input information in a data body that is available on stdin with the data length set in the environment variable CONTENT_LENGTH.
The type attributes values
Value                                                          Description
text                                           Creates a text box where characters can be typed
password                                 Creates a text box where characters can be typed but the input is marked as asterisks                 
checkbox                                  Generates a single check box control
radio                                        Generates a single radio button. Only one radio button in a group can be activated at a time
submit                                      Special button type that submits all the data in the form to CGI script
reset                                         Special button type that resets all the data in the form to CGI script          
file                                           Display a field where files can be inserted for upload
hidden                                     A non-displayed field that contain s data the web page author wants to include in the overall form data
image                                       Creates a graphical submit button
button                                      Creates a push button, which is usually used for client-server scripting

Let us see an Example for  FORM :
                          <HTML>
                          <FORM NAME=”registerform” METHOD=”GET” >
                          <H1>REGISTERATION FORM</H1>
                          <P>User Name:
                             <INPUT TYPE=”text” NAME=”userName” SIZE=”20”>
                          <P>Password:
                             <INPUT TYPE=”password” NAME=”password” SIZE=”12”>
                          <P>E-mail:
                             <INPUT TYPE=”text” NAME=”email” SIZE=”20”>
                          <P>GENDER:<br>
                             <input type="radio" name=r1 value=”MALE”>MALE<br>
                             <input type="radio" name=r1 value=”FEMALE”>FEMALE
                          <br>
                          QUALIFICATION:<br>
                             <input type="checkbox" name=c1 value=”B.Sc”>B.Sc<br> 
                             <input type="checkbox" name=c1 value=”B.C.A">B.C.A<br>
                             <input type="checkbox" name=c1 value=”MBA”>MBA<br>
                             <input type="checkbox" name=c1 value=”MCA”>MCA<br>
                             <input type="checkbox" name=c1 value=”ME”>ME
                          <CENTER>
                             <input type="button" value="Click">
                             <input type="reset" value="Reset">
                             <input type="button" value="Cancel">
                          </CENTER>
</FORM>
</HTML>
                             In above program to perform action of button we can use java and vb script. So in above program button type won’t work.
TEXT AREA:
                          *The <textarea> tag contain multiple lines of text.
                          *The rows attribute sets how many characters high the text area should be.
                          *The cols attribute sets how many characters wide the text area should be.
                          *Any default text should be placed between the<textarea> </textarea> tags.
Example for TEXT AREA and Choice List
                          <html>
                          <form action="reg" method="post">
                          Enter Remarks:<br>
                             <textarea cols=40 name=story rows=7>
                             </textarea><br><br>
                          City:
                             <select name="city"
                                       style="HEIGHT:16 px;WIDTH:106 px">
                                       <option selected>Mumbai
                                       <option>Agra
                                       <option>New Delhi
                                       <option>Chennai</option>
                             </select>
                          </form>
                          </html>


Saturday 24 August 2013

                        In today’s session we are going to see some of the commonly used HMTL tags

HTML TAG REFERENCE
HTML(Outermost Tag)
                   Syntax:
                             <HTML>…</HTML>
                   *Used to identify document as a HTML document.
                    *All HTML document should start with the <HTML> tag and end with the</HTML> tag.

HEAD(DOCUMENT HEADER)
                   Syntax:
                             <HEAD>…</HEAD>
                   *The HEAD tag defines a HTML document header.
                   *You should put all header information between the <HEAD> and </HEAD> tags, which should precede the BODY tag.

BODY(MAIN CONTENT OF A DOCUMENT)
                   Syntax:
                             <BODY
BACKGROUND=”bgURL”
BGCOLOR=”color”
TEXT=”color”
LINK=”color”
ALINK=”color”
VLINK=”color”>
….
</BODY>

BACKGROUND=”bgURL”
                   Specifies an image to display in the background of the document.
BGCOLOR=”color”
                   Sets the color of the background.
TEXT=”color”
                   Set the color of the normal text in the document.
LINK=”color”
                   Sets the default text color of unvisited links in the document.
ALINK=”color”           
                   Specifies the color to which links briefly change when clicked.
VLINK=”color”
                   Specifies the text color of visited links in the document.
FOR EXAMPLE:
          <BODY BGCOLOR=”#FFFAA” TEXT=”black” VLINK=”green” ALINK=”red”>
….
</BODY>

BASE(Base URL)        
 Syntax:
                             <BASE HREF=”baseURL”>

                    =>The HREF attribute is required.
                             HREF=”baseURL”
                   *Specifies the location of the document. This value should be a full path name.
                   *Used within HEAD

FOR EXAMPLE:
          <HEAD><BASE HREF=”http://netscape.com/”></HEAD><BODY><P> Hi this link. Click on it<A HREF=”new.html”>NEW</A>

TITLE(DOCUMENT TITLE)       
                   Syntax:
                             <TITLE>…</TITLE>
                   *Used within HEAD
                   *This title appears in the title bar of  the browser window.


STANDARD HEADINGS
                   Syntax:
                             <H1 ALIGN=”LEFT”|”CENTER”|”RIGHT”>…</H1>
                             <H2 ALIGN=”LEFT”|”CENTER”|”RIGHT”>…</H2>
                             <H3 ALIGN=”LEFT”|”CENTER”|”RIGHT”>…</H3>
                             <H4 ALIGN=”LEFT”|”CENTER”|”RIGHT”>…</H4>
                             <H5 ALIGN=”LEFT”|”CENTER”|”RIGHT”>…</H5>
                             <H6 ALIGN=”LEFT”|”CENTER”|”RIGHT”>…</H6>

*H1 to H6
                   *Headings are usually  displayed in bolder, lager font than normal body text.                                                                                
                   ALIGN: Specifies the horizontal alignment of the heading.
                             =>LEFT
                             =>RIGHT
                             =>CENTER
P (PARAGRAPH)
                   Syntax:
                             <P
                             ALIGN==”LEFT”|”CENTER”|”RIGHT”
> 
….
</P>
                   ALIGN: Specifies the horizontal alignment of the paragraph.

PRE (PREFORMATTED TEXT,FIXED-WIDTH FONT)
                   Syntax:
                             <PRE
COLS=”columns”
WRAP
>…
</PRE>
                   COLS=”columns”
                                       Specifies the maximum no: of characters that fit on a line.
                   WRAP
                                      Turns on wrapping, so that all lines fit inside the browser.


LISTS
                   This selection describes the tags for displaying lists.
          DL(DEFINITION LIST)
                   Syntax:
                             <DL COMPACT
>…
</DL>
          DT(DEFINITION TERM)
                   Syntax:
                             <DT
                             >
Used within <DL>

          DD(DEFINITION DESCRIPTION)
                             Syntax:
                             <DD
> 
Used within <DL>
          NOTE: DT tag and DD tag does not require a closing tag.
          FOR EXAMPLE:
                   <DL COMPACT>
                   <DT>HTML
                             <DD>This  tag marks a text file as aHTML document.
                   </DL>

OL(ORDERED LIST):
                   Syntax:
                             <OL
START=”value”  
TYPE=”A”|”a”|”I”|”i”1
> 
….
</OL>
          START: Indicates the starting number for the list. Number must be +ve integer..
          TYPE: defines the type of numbering sequence used for each list item.
                   *A specifies a sequence of uppercase letters.
                   *a specifies a sequence of lowercase letters.
                   *I specifies a sequence of uppercase Roman numerals.
                   *i specifies a sequence of lowercase Roman numerals.
                   *1 specifies a sequence of numbers.

UL(UNORDERED LIST)
                   Syntax
                             <UL TYPE=”CIRCLE”|”DISC”|”SQUARE”>
          TYPE: defines the type of bullet used for each item.

LI(LIST ITEM)
                   Syntax
                             <LI
TYPE= CIRCLE”|”DISC”|”SQUARE”| ”A”|”a”|”I”|”i”1
VALUE=”number”
>

HORIZONTAL RULES:
                   Syntax:
                             <HR SIZE=”value”>…...</HR>
                   *Used to produce a horizontal line.

FOR EXAMPLE:
          <HTML>
          <HEAD>
<H1 ALIGN=”CENTER”>SAMPLE</H1>
<TITLE>MY SAMPLE PROGRAM</TITLE>
</HEAD>
<HR SIZE=”20”/>
<BODY  BGCOLOR=”#FFFAA”  TEXT=”black” LINK=”blue” VLINK=”green”  ALINK=”red”>
<PRE>
<OL START=1" TYPE="I">
<LI><A HREF=”www.google.com”>GOOGLE</A><BR>
<LI><A HREF=”www.yahoo.com”>YAHOO</A><BR>
<LI><A HREF=”www.microsoft.com”>MICROSOFT</A><BR>
</OL>

<UL TYPE="CIRCLE">
<LI><A HREF=”www.google.com”>GOOGLE</A><BR>
<LI><A HREF=”www.yahoo.com”>YAHOO</A><BR>
<LI><A HREF=”www.microsoft.com”>MICROSOFT</A><BR>
</UL>
</PRE>
</BODY>
</HTML>


TEXT CHARACTERISTICS

          B(BOLD FACE): used to display text in boldface type
                   Syntax:
                             <B>…</B>
          BLINK(BLINKING TEXT): used  to make text blink on and off
                   Syntax:
                             <BLINK>…</BLINK>

EM(EMPHASIZED TEXT): used to display text in an emphasized style.
          Syntax:     
                   <EM>…</EM>


FONT(FONT COLOR,FACE AND SIZE)
                   *Used to change the color,size and typeface of the font
                   *All text between the <FONT> and </FONT> tags is displayed with specified font characteristics.
                   Syntax:
                             <FONT COLOR=”color”  FACE=”fontlist”  POINT-SIZE=”pointsize”
SIZE=”number”  WEIGHT=”boldness”>…</FONT>
         

I (ITALICS): used to display text in Italic
                   Syntax:
                                      <I>…</I>
         
STRIKE(STRIKEOUT TYPE): display text with a line through it.
Syntax:
                                      <STRIKE>…</STRIKE>
         
U (UNDERLINE): underlines the text it encloses
                   Syntax:
                                      <U>…</U>         

SUB (SUBSCRIPT): display text as a subscript ie appears slightly below the baseline         and in smaller font.
                   Syntax:
                                      <SUB>…</SUB>                  

SUP (SUPERSCRIPT): display text as a superscript ie appears slightly above the top of the preceding text and in smaller font.
                   Syntax:
                                      <SUP>…</SUP>
         
BR(LINE BREAK ): inserts a line break.
                   Syntax:
                                      <BR>
         
CENTER(CENTERED CONTENT): centers the content enclosed with it
                   Syntax:
                                      <CENTER>…<CENTER>

          IMG(IMAGE)
                   *Used to specifies an image to be displayed in the HTML document.       
                   Syntax:
                             <IMG SRC=”location”  ALT=”alternative Text”  ALING=”alignment”
BORDER=”border width”  HEIGHT=”height”  WIDTH=”width”
          HSPACE=”horizMargin”  VSPACE=”verticalMargin”>
         
FOR EXAMPLE:
                   <HTML>
<HEAD><H3 ALIGN="RIGHT">FONT DESIGN</H3>
<TITLE>FONT</TITLE>
<HR SIZE="30" />
</HEAD>
<BODY><CENTER><B><I><U>
HI WELCOME TO JUST ENJOY BLOG
</B></I></U></CENTER>
<BLINK>Learn</BLINK> here to create our <EM>basic</EM>
own web form.
<P><FONT COLOR="GREEN" FACE="TIMES NEW ROMAN"
SIZE="5">THERE ARE DIFFERENT FONT SYTLE AND SIZE
ARE AVAIL; THIS SESSION MAKES U CLEAR ABOUT
IT.</FONT><BR>
<FONT COLOR="RED" FACE="TIMES NEW ROMAN" SIZE="4">  <U>UNDERLINE</U><BR>
<I>ITALICS</I><BR>
<STRIKE>STRIKEOUT</STRIKE>
</FONT><BR><CENTER>
<IMG SRC="D:\New Folder\zara_tiny_angel.jpg"
ALIGN="MIDDEL" HEIGHT=300 WIDTH=300/><EM><B><BR>
ALL THE BEST!</B><EM></CENTER>
</HTML>