Home TechnologyProgrammingHTML Subscribe to RSS

What Is Difference Between Cellpading And Cellspacing In HTML?

Answer Question

4 Answers - Sort by: Date | Rating

    In HTML, the table tag has two properties, cellspacing and cellpadding. Cellspacing controls the space between table cells by defining the pixel width between them (controls the thickness of the border in other words). Cellpadding controls the amount of space between the contents of the cell (text, images, etc) from the cell wall (border). The default for both properties is zero.

    Here are some samples:

    < table border="1" >
    < tr >
    < td >some text< /td >
    < td >some text< /td >
    < /tr >< tr >
    < td >some text< /td >
    < td >some text< /td >
    < /tr >
    < /table >

    What it looks like:
    i157.photobucket.com

    < table border="1" cellspacing="5" >
    < tr >
    < td >some text< /td >
    < td >some text< /td >
    < /tr >< tr >
    < td >some text< /td >
    < td >some text< /td >
    < /tr >
    < /table >

    What it looks like:
    i157.photobucket.com

    < table border="1" cellpadding="10" >
    < tr >
    < td >some text< /td >
    < td >some text< /td >
    < /tr >< tr >
    < td >some text< /td >
    < td >some text< /td >
    < /tr >
    < /table >

    What it looks like:
    i157.photobucket.com
    0 0

    Revelation  

    answered 3 years ago

      The cellspacing attribute adjusts the space between the cells and cellpadding adjust the space within the cells.
      0 0

      Khaledh  

      answered 3 years ago

        Cellpading is the distance between cell and text in the cell and cell spacing is the distance between two cells.
        0 0
        Guest

        Guest  

        answered 6 months ago

        Cell padding= Distance in pixel between the cell border and its content.cell spacing= Distance in pixel between the two Respected cells.
        0 0

        Rakadive  

        answered 2 months ago

        More

        More

           
           

          Ask a Question via Twitter

          Send a question to @askblurtit and we will publish it online and send you a reply everytime you receive an answer.

          Blurtit Store

          Get T-shirts, hoodies, caps and more at the Blurtit store

          Blurtit International