The ____ attribute of <TABLE> tag is used to control the distance between the…

2018

The ____ attribute of <TABLE> tag is used to control the distance between the data in a cell and the boundaries of the cell.

  1. A.

    colspan

  2. B.

    rowspan

  3. C.

    cellpadding

  4. D.

    cellspacing

Attempted by 417 students.

Show answer & explanation

Correct answer: C

Key point: The cellpadding attribute of the <table> tag controls the space between the cell content and the cell border.

  • Default value: 0 (no inner spacing).

  • Value is commonly given in pixels (for example, cellpadding="10").

  • Difference from cellspacing: cellpadding adds space inside a cell (between content and border); cellspacing adds space between cells (between borders).

  • Modern recommendation: cellpadding is deprecated in HTML5. Use CSS padding on table cells instead (for example, td { padding: 10px; }).

Syntax: <table cellpadding="pixels">

Correct answer: cellpadding

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Up Lt Grade Assistant Teacher 2025