Skip to main content

Difference between Cellspacing and Cellpadding



Cellspacing and Cellpadding are two important attributes of  <Table> tag. As you know <Table> tag is used to create and display tables in HTML documents.

What is CELLSPACING?

Cellspacing is an important attribute of <Table> tag in HTML. Cellspacing specifies the spacing between adjacent cells in a table. Consider the following example of an HTML table with cellspacing attribute set to 50.

Example of Cellspacing use

<TABLE border="1" cellspacing="30">
<th>Name</th><th>Marks</th>
<tr><td>Sajid Mahmood</td><td>666</td>
<tr><td>Majid Karim</td><td>555</td>
</table>

NameMarks
Sajid Mahmood666
Majid Karim555

Example of Cellspacing=15

<TABLE border="1" cellspacing="15">
<th>Name</th><th>Marks</th>
<tr><td>Sajid Mahmood</td><td>666</td>
<tr><td>Majid Karim</td><td>555</td>
</table>

NameMarks
Sajid Mahmood666
Majid Karim555

Example of Cellspacing=0

<TABLE border="1" cellspacing="0">
<th>Name</th><th>Marks</th>
<tr><td>Sajid Mahmood</td><td>666</td>
<tr><td>Majid Karim</td><td>555</td>
</table>

NameMarks
Sajid Mahmood666
Majid Karim555

What is CellPadding?

Cellpadding is used to specify the distance between a cell contents and its boundaries. For example, consider the following table with cellpadding=0

Example of Cellpadding=0

<TABLE border="1" cellpadding="0">
<th>Name</th><th>Marks</th>
<tr><td>Sajid Mahmood</td><td>666</td>
<tr><td>Majid Karim</td><td>555</td>
</table>

NameMarks
Sajid Mahmood666
Majid Karim555

Example of Cellpadding=20

<TABLE border="1" cellpadding="20">
<th>Name</th><th>Marks</th>
<tr><td>Sajid Mahmood</td><td>666</td>
<tr><td>Majid Karim</td><td>555</td>
</table>

NameMarks
Sajid Mahmood666
Majid Karim555

Example of Cellpadding=50

<TABLE border="1" cellpadding="50">
<th>Name</th><th>Marks</th>
<tr><td>Sajid Mahmood</td><td>666</td>
<tr><td>Majid Karim</td><td>555</td>
</table>

NameMarks
Sajid Mahmood666
Majid Karim555

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 Data Processing Cycle and Main Activities of Data Processing Cycle

After collecting data, it is processed to convert into information. The data is processed again and again until accurate result is achieved. This is called data processing cycle . Data processing cycle involves following three basic activities: Major Activities Involved in Data Processing Cycle Explain Data processing cycle 1. Input 2. Processing 3. Output 1. INPUT It is the process in which collected data is given to computer after converting into binary form. Input step can be further divided into following steps: i) Planning Here objectives of data processing are defined. For example, in examination system, objective is to process student examination data to get result cards. ii) Data Collecting Here data is collected. Data is the raw material for data processing. This must be accurate for getting accurate results. iii) Input Here data is entered into computer. iv) Verification Here collected data is verified to determine whether it is valid for ...

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...