Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Cellpadding and Cellspacing in CSS

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 3
    • 0
    • 560
    Comment on it

    Hey Readers!

    Cell padding and cellspacing are two important attributes of <table> tag.

    Let us take an insight into both the concepts.

     

     

    1.  CELL PADDING

     The cellpadding attribute is more of like padding attribute. Like padding, it gives the space between the contents of the cell and the walls of the cell.

    See what effect does the attribute produce.

     

    Without cell padding:

     

    With cell padding :

     

    Since cellpadding attribute gives the space, hence the value is given in pixels.

    The syntax is :

    table {
        border-collapse: collapse;
    }
    
    td {
        padding: 10px;
    }

    OR

    td {
        cellpadding: 10px;
    }

     

         

          2. CELL SPACING


    Just like any spacing attribute would do, the cellspacing attribute gives the space between the cells.

    This attribute produce the following effect :

    This attribute is also specified in pixels.

    The syntax is given as follows :

    table {
        cellspacing: 2px;
    }

     

    Unfortunately, both these attributes are not supported in HTML5. Use CSS instead.

     

    Keep Coding!

    Cellpadding and Cellspacing in CSS

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: