Skip navigation
alexi dave
Currently Being Moderated

padding only for text and not image

Nov 17, 2012 9:54 PM

Tags: #dreamweaver #indent #text_wrap #cellpadding #padding_only_for_text #insert_padding #remove_padding

hey guys say there are text and images in a cell of a table and i want to give padding to text only and not the photos which will give me the effect where the text doesn't stick with the border but the photos do. anyone willing to help? thanks have a nice day

 
Replies
  • Currently Being Moderated
    Nov 18, 2012 1:06 AM   in reply to alexi dave

    There are a couple of ways that you could do this. One is to put the text in your table cells in paragraphs, and then create a style rule to add a margin to paragraphs inside cells like this:

     

    td p {

        margin: 10px;

    }

     

    Alternatively, you could add padding to all cells, and apply a class to remove it from cells with images:

     

    td {

        padding: 10px;

    }

    td.image {

        padding: 0;

    }

     

    Apply the image class to cells with images.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points