In HTML tables gaps between two cells of same tables are known as what
Answers
Answer:
Space Between Table Cells
The space between the table cells is controlled by the CELLSPACING attribute in the TABLE tag. By setting CELLSPACING to zero, you can remove all the space between the cells of your table.
Let's start by setting CELLSPACING and BORDER to zero for our example (the rest of the code remains the same):
<TABLE BGCOLOR="#FFFFCC" BORDER=0 CELLSPACING=0>
This removes all the space between the cells of our table (see Figure
9).
Figure 9 Our example with CELLSPACING=0.
Notice that this example leaves all the text jammed up against the edges of the cells. You can adjust the space inside of the cell borders with the CELLPADDING attribute (see Figure 10).
<TABLE BGCOLOR="#FFFFCC" BORDER=0
CELLSPACING=0 CELLPADDING=5>
Figure 10 The table with CELLSPACING=0 and CELLPADDING=5.
This gives a little breathing room for the text inside the cells.
This technique can be nicely applied to columnar-type data, giving you some design flexibility that would otherwise be difficult without using large graphics files:
<TABLE BGCOLOR="#FFFFCC" BORDER=0
CELLSPACING=0 CELLPADDING=6>
<TR><TD>
You will find designs in our catalog which cover a
vast array of categories:
<TR><TD BGCOLOR="#CCCC99"> floral images
<TR><TD> humor
<TR><TD BGCOLOR="#CCCC99"> holiday stamps
<TR><TD> border designs
<TR><TD BGCOLOR="#CCCC99"> decorative imagery
</TABLE>
In this decorative table (shown in Figure
11), we use a separate row for each element of the list. Remember: You need both a TR and a TD to create a row. In this example, we used a BGCOLOR in the TABLE tag as a default and then changed the color in every other row.
Figure 11 A decorative table for listing options.
There are many other interesting designs you can create by using tables. Hopefully, we've given you enough tools to be able to experiment on your own, and use your creativity.
In HTML tables gaps between two cells of same tables are known as CellSpacing
- The distance between the cells in a table is referred to as cell spacing. Cellspacing, an attribute of the table element, is used to specify it.
- In values, the number of pixels is indicated. Wider shaded borders between cells are produced when cell spacing is increased.
- The distance between the cells is defined by the HTML table> cellspacing Attribute.
- Pixels are used to specify the cellspacing attribute. Formatting: table cellspacing="pixels"> Attribute pixels: values The number of pixels used to set the cell spacing.
<!DOCTYPE html>
<html>
<head>
<title>
HTML table cellspacing Attribute
</title>
</head>
<body>
<h1>GeeksforGeeks</h1>
<h2>HTML table cellspacing Attribute</h2>
<table border="1"
cellspacing="15">
<caption>Author Details</caption>
<tr>
<th>NAME</th>
<th>AGE</th>
<th>BRANCH</th>
</tr>
<tr>
<td>BITTU</td>
<td>22</td>
<td>CSE</td>
</tr>
<tr>
<td>RAM</td>
<td>21</td>
<td>ECE</td>
</tr>
</table>
</body>
</html>
Hence, in HTML tables gaps between two cells of same tables are known as CellSpacing.
#SPJ3