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

Explain Main Difference Between System Software and Application Software

Topic: Explain Main Difference Between System Software and Application Software            Differentiate between system software and application software Before , explaining the main differences between application software and system software, let us know the definitions of Application software and System software with examples. What is System Software: System software is a set of programs to control all components of computer and to manage overall operations of computer system. Differences between System software and application software System software is used as a base to install and run all application software. Examples of system software include: Operating Systems, like Microsoft Windows, DOS, Unix and Linux Device Drivers like Device driver software of a Printer (found on CD normally provided with the printer) Utility Programs like AVAST anti virus, Disk Scanners and File Viewers etc. What is Applicat...

Explain Different Types of Data Processing and Advantages Disadvantages

Today we will discuss different types or levels of data processing in detail. Let us define Data processing first. DATA PROCESSING Data processing is the sequence of operations performed on data to convert it into useful information . These operations may be arithmetic, statistical or logical operations. We can arrange or classify data. We can send and receive data from one point to another. Explain different types of data processing TYPES OF DATA PROCESSING (OR) LEVELS OF DATA PROCESSING) There are three types of data processing . 1) Manual data processing 2) Mechanical data processing 3) Electronic data processing We may also use the term Levels of data processing. First level of data processing was manual data processing when there were no calculating devices (before the invention of calculators). Therefore all processing jobs were performed manually by hand with the help of pen , paper and mind. In second level of data processing, machines like calculat...

Explain Different Types Of Computer Networks - LAN, MAN, WAN

Explain different types of computer networks:(LAN,WAN,MAN) Today, we will discuss the main types of computer networks on the basis of the maximum distance covered where they can be accessed and operate. The main types of computer networks are: LAN, WAN, MAN Explain different types of computer networks 1.    LAN - Local-Area Network 2.    WAN - Wide-Area Network 3.    MAN - Metropolitan-Area Network 1)LAN (Local Area Network) What is LAN or Local Area Network LAN stands for Local Area Network . It covers a small area. Most LANs are used to connect computers in a single building or group of near buildings. A network contained within a relatively small area, such as a classroom, school, or single building, is commonly referred to as a local area network. Hundreds or thousands of computers may be connected through LAN . LANs are used in office buildings, college or university campus etc. Local Area Networks can t...