[thelist] TIP: TD Padding

Tom Dell'Aringa pixelmech at yahoo.com
Tue Aug 3 16:33:28 CDT 2004

--- Casey Crookston <casey at thecrookstons.com> wrote:
> <td
> style="padding-left:10px;padding-top:15;padding-right:10px;padding-bottom:15
> px ">
> Using these style tags inside a td is wonderfully helpful in getting the
> exact layout, without using clear images and without heavy css.  It's fast
> and handy.

Just a side note on this tip, unless you must have this in your HTML for some reason you ought to
set a class for this in your CSS, lest you end up with just as many TD styles as FONT tags. Even
better, use a descendant selector (30 class attributes in your HTML is just as undesireable):

Name your table:

<table .... id="myTable">

now your style:

/* table with padded cells */
#myTable td {
   padding: 15px 10px;   

This requires zero upkeep WITHIN your html which is what you want. Keep your presentation code OUT
of your HTML! Change them all at once if you need. You can get more specific from here if you need
to :)


http://www.Pixelmech.com/ - read my latest blog posting!

John 3:16

More information about the thelist mailing list