HighDots Forums  

Unable to apply class style to table row?

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Unable to apply class style to table row? in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
dexter manika
 
Posts: n/a

Default Unable to apply class style to table row? - 02-16-2009 , 12:44 AM






created a class style with 10px pad on right side only & vertical alignment to
top.

i want to apply this class to a table row-- but when i do-- i get correct
vertical alignment-- but no pad.

if i apply the same class style to each td cell-- then both alignment and pad
work.

am i making some silly mistake? there are 40 td cells in the row-- so it
would be faster just to apply class to entire row. any ideas what i'm doing
wrong? much thanks in advance.


Reply With Quote
  #2  
Old   
kiusau
 
Posts: n/a

Default Re: Unable to apply class style to table row? - 02-16-2009 , 01:56 AM






[Q]i want to apply this class to a table row-- but when i do-- i get correct
vertical alignment-- but no pad.[/Q]

Why would you expect that by adding left or right padding to a <tr> tag you
could effectuate padding within a <td> tag. In general, the first controls
vertical placement and the second controls horizontal placement. If such
padding has any effect at all, then it would probably appear along the left and
right sides of the table in which the row is contained? Check there to see, if
there is no displacement.

I do not know how many rows you have in your table, but if the padding is to
be applied to all of the cells in a single or every column, then I would look
for a solution in your column or table, not row elements.

Roddy


Reply With Quote
  #3  
Old   
Murray *ACE*
 
Posts: n/a

Default Re: Unable to apply class style to table row? - 02-16-2009 , 07:39 AM



Padding doesn't inherit into descendent tags. And, a <tr> doesn't pad
anyhow.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"dexter manika" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
created a class style with 10px pad on right side only & vertical
alignment to
top.

i want to apply this class to a table row-- but when i do-- i get correct
vertical alignment-- but no pad.

if i apply the same class style to each td cell-- then both alignment and
pad
work.

am i making some silly mistake? there are 40 td cells in the row-- so it
would be faster just to apply class to entire row. any ideas what i'm
doing
wrong? much thanks in advance.



Reply With Quote
  #4  
Old   
Murray *ACE*
 
Posts: n/a

Default Re: Unable to apply class style to table row? - 02-16-2009 , 07:41 AM



And by the way, the best way to do this would be as follows, using a
descendent selector -

..padThis td { vertical-align:top; padding:10px; }

....

<tr class="padThis">
<td>

Now, all the <td> tags within that <tr> will have the padding and alignment
you want.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"dexter manika" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
created a class style with 10px pad on right side only & vertical
alignment to
top.

i want to apply this class to a table row-- but when i do-- i get correct
vertical alignment-- but no pad.

if i apply the same class style to each td cell-- then both alignment and
pad
work.

am i making some silly mistake? there are 40 td cells in the row-- so it
would be faster just to apply class to entire row. any ideas what i'm
doing
wrong? much thanks in advance.



Reply With Quote
  #5  
Old   
kiusau
 
Posts: n/a

Default Re: Unable to apply class style to table row? - 02-16-2009 , 01:19 PM



[q]And by the way, the best way to do this would be as follows, using a
descendent selector.

STYLE SHEET
.padThis td { vertical-align:top; padding:10px; }

HTML DOCUMENT
<tr class="padThis">
<td>blah, blah, blah</td>
<td>blah, blah, blah</td>
<td>blah, blah, blah</td>
</tr>

Now, all the <td> tags within that <tr> will have the padding and alignment
you want.[/q]

Very Nifty.

Roddy


Reply With Quote
  #6  
Old   
Murray *ACE*
 
Posts: n/a

Default Re: Unable to apply class style to table row? - 02-16-2009 , 01:21 PM



Yes, thanks. Descendent selectors can be an epiphany for new CSS learners,
and will definitely unclutter your stylesheets by moving out the myriad
custom classes and replacing them with context-based selectors.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"kiusau" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
[q]And by the way, the best way to do this would be as follows, using a
descendent selector.

STYLE SHEET
.padThis td { vertical-align:top; padding:10px; }

HTML DOCUMENT
tr class="padThis"
td>blah, blah, blah</td
td>blah, blah, blah</td
td>blah, blah, blah</td
/tr

Now, all the <td> tags within that <tr> will have the padding and
alignment
you want.[/q]

Very Nifty.

Roddy



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.