Tables-Html

March 21, 2009 at 11:18 am | In Ultimate Concepts-Html | Leave a Comment
Tags: , ,

Tag Name- <table>

Description- This tag is generally used to insert a table into the web pages. Now as the table consists of rows and columns thus we have two more tags for this reasons-

  1. <tr>- i.e used to insert a new row in the table.
  2. <td>- i.e used to insert new column in the table.

Generally we have to write “tr” tag first to insert a row after which we put tag “td” to insert no. of columns in that particular row.(See Ultimate exaple at end>>)

Now coming to the attributes of table which are as follows:-

  • Border- i.e used to change the width of the border of the table.(e.g- border=”any integer value”; by default it is zero)
  • Width- i.e used to change the width of the table.(e.g- width=”any integer value”)
  • Height- i.e used to change the height of the table.(e.g- height=”any integer value”)
  • Align- i.e used to align the table.(e.g- align=”left/right/center”)
  • Bgcolor- i.e used to specify a colour as the table background.
  • Background- i.e used to insert an image as the table background.(e.g- background=”abc.gif”)
  • Border Color- i.e used to specify a colour for the table border.(e.g- bgcolor=”#ff000″)
  • Cellpadding- i.e used to adjust the distance between the cell’s content and the border of the table.
  • Celllspacing- i.e used to adjust the distance between the cell’s of the table.

Note- If you change up the height or width of the table than width and height of the cell’s in the table will also get changed automatically.

While beside this the other tag i.e<td> also have a no. of attributes like-

  • Width- i.e used to change the width of particular cell in the table.(e.g- width=”any integer value”)
  • Height- i.e used to change the height of particular cell in the table.(e.g- height=”any integer value”)
  • Align- i.e used to align the content of a particular cell in the table.(e.g- align=”left/right/center”)
  • Bgcolor- i.e used to specify a colour for a particular cell in the table.(e.g- bgcolor=”#ff000″)
  • Background- i.e used to insert an image in a particular cell in the table.(e.g- background=”abc.gif”)
  • Colspan- i.e used to merge a no. of columns into one.(e.g- colspan=”no. of columns to be merged”)
  • Rowspan- i.e used to merge a no. of rows into one.(e.g- rowspan=”no. of rows to be merged”)

Ultimate Example

<html><head><title>Table</title></head><body><center><h1>ultimatepedia</h1></center><br>

<table border=”1″ align=”center” bgcolor=”#000fff” bordercolor=”white” height=”100″ width=”100″>

<tr><td colspan=”2″>Cell01</td><td>Cell02</td><td>Cell03</td></tr>

<tr><td>Cell11</td><td>Cell12</td><td>Cell13</td></tr>

<tr><td>Cell21</td><td>Cell22</td><td align=”center”>Cell23</td></tr></table></body></html>

Output

Table

Password in a c++ program

March 15, 2009 at 9:22 am | In Ultimate Concepts-C++/C | Leave a Comment
Tags: , ,

Many of us keep want this ultimate solution, “that how can we add provide a password facility in a c++ or c program?”. Yes password facility such that if user enter “UltimatePedia” as his password then it should be displayed over the screen something like-”*************”. So here i give you the solution of this query (asked to me by many of you through mails):-

 

 #include<iostream.h>  //Header file for cout and cin.

#include<conio.h> //Header file for clrscr().

void main()

{ clrscr();  //To clear off the screen.

   char psw[20];  //Size of the password.

   char psw2=13;  //Basically here 13 is the ASCII value for the “Enter”.

   int i=-1;

   cout<<”Enter your Password:”;

   do{ i++;

   psw[i]=getch();

   cout<<”*”;  //Displays “*” instead of the characters entered by the user.

   }while(psw[i]!=psw2);  //This loop runs untill user press enter or character limit for password is reached.

cout<<”ntPassword is accepted. Your password is:”<<psw;  //Optional facility which displays the password as entered by the user. Note that it does not show the password in the “*”  form.

getch();  //Termination of the program.

}

 

Now do i hope you can modify this program according to your need in a program. And if you still have any queries related to its working then do ask me.

Next Page »

Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.