Skip to main content

Use Of Colspan and Rowspan in Tables HTML

Colspan and Rowspan are two important attributes of TD and TH tags used in HTML tables.

Colspan




Colspan is an attribute of TD or TH tags used to make data cells and header cells in an HTML table. We can use Colspan to expand / span a cell on many columns. For example, in the following table, the first header cell spans two columns, so here we use <th colspan="2">Marks</th> to get the required result in the displayed html table.

Marks
MathsComputer
10087
The complete HTML coding is as follows:

<table border="1">
<tr> <th colspan="2">Marks</th> </tr>
<tr> <th>Maths</th><th>Computer</th></tr>
<tr> <td>100</td><td>87</td> </tr>
</table>

Rowspan

Rowspan attribute is used to expand or span a cell to multiple rows. For example, in the following table example, the first TH cell (Marks) spans on two rows. We use <th rowspan="2">Marks</th> for this purpose.


Marks
MathsComputer
10087

The complete HTML coding of the table is as follows:
<table border="1">
<tr> <th rowspan="2">Marks</th>
<th>Maths</th><th>Computer</th></tr>
<tr><td>100</td><td>87</td></tr>
</table> 

Comments

Popular posts from this blog

Define Data and Information With Examples

DATA Data is the collection of raw facts and figures. Actually data is unprocessed, that is why data is called collection of raw facts and figures. Define Data and Information with Examples We collect data from different resources. After collection, data is entered into computer for processing. Data may be collection of words, numbers, pictures,  or sounds etc. Examples of Data 1) Student Data on Admission Forms When students get admission in a college. They fill admission form. This form  contains raw facts (data of student) like name, father’s name, address of student, obtained marks, photo graph etc. 2)    Data of Citizens During census, data of all citizens is collected. The staff will go house to house and collect data about citizens like number of persons living in a home, either they are literate or illiterate, number of children, data of each child, cast, religion, Computerized national Identity Card number, address, how many rooms and other facilities in the

Important Objective Type Questions 101-155

MMC stands for multimedia card. SD stands for secure digital card. System Bus  is used to connect main components of a computer such as cpu and main memory. A Port is an interface or a point of attachments. POS stands for Point Of Sale terminal. ATM stands for Automated Teller Machine. PIN stands for Personal identification number. Kbps stands for kilobits per second. Mbps stands for megabits per second. A port that transmits one bit at a time is called Serial Port. A type of port that transmits many bits at a time is called Parallel Port. LPT stands for Line Printer. Examples of system software are Operating System, Utility Programs and Device Drivers. Examples of operating systems are DOS, Windows, Unix and Linux. Examples of Utility programs are File Manager, Image Viewer, Disk Scanner and File Compressor. Software used to detect and remove viruses is called Antivirus . Examples of antivirus programs are Mcaffee, Avast,

Explain Parts of CPU and its Working

CENTRAL PROCESSING UNIT / CPU / Microprocessor / Processor Central processing unit is the brain of computer. It is also called CPU or processor . Processor is used to process data according to given instructions. It performs arithmetic and logical operations on data. Parts / Components of CPU / Processor on computergap.com It controls all activities of different parts of a computer . As brain in human body controls all other parts of body and takes decisions, CPU controls all other parts of the computer and their working. A CPU has three basic parts: Arithmetic Logic unit, Control unit and Registers. Parts of Microprocessor or Processor or CPU or Central Processing Unit computergap.com 1.    ARITHMETIC LOGIC UNIT (ALU) ALU performs data processing according to given instructions. All computations are done in this unit. ALU is the real place in computer where actual execution of instructions takes place. ALU may be further categorized into two sections acco