Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 83 - 2611_SmartGPT Pro V(5.0) C-7
P. 83

    PADDING PROPERTY
                     We use padding to add space between the border and the contents of a cell. We can use spacing

                     to increase the border size or distance between cells. Since the table contents are present in <TH>
                     and <TD>, the padding property is declared for these two elements in the style tag.

                                 Property                 Value                       Description

                                                                           It specifies  the  space  between  cell
                                                  length
                                                                           contents in cm, px or pts.

                           padding                                         It specifies  the space  between  the

                                                  %                        cell contents in the percentage of the
                                                                           element in which it is used.

                     Write HTML code to add space between contents of cell and the border.

                     <!DOCTYPE html>
                     <HTML>

                     <HEAD><TITLE> A Simple Table Structure </TITLE>
                     <STYLE>

                     TABLE,TH,TD
                     {

                     Border:2px solid black;
                     Border-collapse:collapse;

                     }
                     TH, TD

                     {
                     padding: 30px;

                     }

                     </STYLE>
                     </HEAD>
                     <BODY>

                     <TABLE>

                     <CAPTION>STUDENT'S DETAILS</CAPTION>
                     <TR>

                     <TH>ADMISSION</TH>
                     <TH>NAME</TH>

                                                                                              Lists and Tables in HTML5  81

| 78 79 80 81 82 83 84 85 86 87 88 |