![]() |
![]() |
||||||
|
|||||||
| Tags: |
![]() |
|
|||
|
Good evening,
I am trying to add css to a table but not having any luck at all. I need to be able to add a 1px black border around it .The cells should align to the top and I need to change the table row colors, so one row would be one color and the next a different one. I just can't figure it out. Any help would be great. I am using an internal style sheet. Thank you. Here is my table code. <body> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td>text text text</td> <td> text text text</td> </tr> <tr> <td> text text text </td> <td> text text text </td> </tr> <tr> <td> text text text </td> <td><p> text text text </p></td> </tr> <tr> <td> text text text </td> <td> text text text </td> </tr> <tr> <td> text text text </td> <td> text text text </td> </tr> <tr> <td>text text text </td> <td> text text text </td> </tr> </table> </body> </html> |
| Sponsored Links |
|
|||
|
I guess Im a little confused because I dont see any CSS. You can simply
change <table border="1" and make the color #000000. Or you could apply CSS to it and simply add a border. Name the table then create the corresponding CSS with... border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #000000; repeat for top and sides... Gary "snapply" <webforumsuser@macromedia.com> wrote in message news:gcbk84$1s2$1@forums.macromedia.com... > Good evening, > > I am trying to add css to a table but not having any luck at all. I need > to be > able to add a 1px black border around it .The cells should align to the > top and > I need to change the table row colors, so one row would be one color and > the > next a different one. I just can't figure it out. Any help would be > great. I > am using an internal style sheet. > Thank you. Here is my table code. > > <body> > <table border="0" cellspacing="0" cellpadding="0"> > <tr> > <td>text text text</td> > <td> text text text</td> > </tr> > <tr> > <td> text text text </td> > <td> text text text </td> > </tr> > <tr> > <td> text text text </td> > <td><p> text text text </p></td> > </tr> > <tr> > <td> text text text </td> > <td> text text text </td> > </tr> > <tr> > <td> text text text </td> > <td> text text text </td> > </tr> > <tr> > <td>text text text </td> > <td> text text text </td> > </tr> > </table> > > </body> > </html> > > > > |
|
|||
|
Hello,
How about something like this? <style type="text/css"> <!-- body { margin: 0px; padding: 0px; } #maintable { border: 1px solid #000; background-color:#FFFFCC; } #maintable td { vertical-align:top; } #maintable p { margin: 0px; } tr.oddrow td{ background-color:#6699FF; } --> </style> </head> <body> <table cellpadding="0" cellspacing="0" id="maintable"> <tr class="oddrow"> <td>text text text</td> <td>text text text</td> </tr> <tr> <td>text text text </td> <td>text text text </td> </tr> <tr class="oddrow"> <td> text text text </td> <td><p>text text text</p></td> </tr> <tr> <td>text text text </td> <td>text text text </td> </tr> <tr class="oddrow"> <td>text text text </td> <td>text text text </td> </tr> <tr> <td>text text text </td> <td>text text text </td> </tr> </table> </body> </html> Vertical align top won't work in IE5 for mac, but if you want to code for that one you can just add valign="top" to each td. Take care, Tim "snapply" <webforumsuser@macromedia.com> wrote in message news:gcbk84$1s2$1@forums.macromedia.com... > Good evening, > > I am trying to add css to a table but not having any luck at all. I need > to be > able to add a 1px black border around it .The cells should align to the > top and > I need to change the table row colors, so one row would be one color and > the > next a different one. I just can't figure it out. Any help would be > great. I > am using an internal style sheet. > Thank you. Here is my table code. > > <body> > <table border="0" cellspacing="0" cellpadding="0"> > <tr> > <td>text text text</td> > <td> text text text</td> > </tr> > <tr> > <td> text text text </td> > <td> text text text </td> > </tr> > <tr> > <td> text text text </td> > <td><p> text text text </p></td> > </tr> > <tr> > <td> text text text </td> > <td> text text text </td> > </tr> > <tr> > <td> text text text </td> > <td> text text text </td> > </tr> > <tr> > <td>text text text </td> > <td> text text text </td> > </tr> > </table> > > </body> > </html> > > > > |
|
|||
|
Hello,
border: 1px solid #000; will place a black border on all 4 sides of the table. It's shorthand instead of having to write: border-top-width: 1px; border-top-style: solid; border-top-color: #000000; border-right-width: 1px; border-right-style: solid; border-right-color: #000000; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #000000; border-left-width: 1px; border-left-style: solid; border-left-color: #000000; Take care, Tim "GPaul" <gwpaul@ptd.net> wrote in message news:gcbl3n$2ta$1@forums.macromedia.com... >I guess Im a little confused because I dont see any CSS. You can simply >change <table border="1" and make the color #000000. > > Or you could apply CSS to it and simply add a border. Name the table then > create the corresponding CSS with... > > border-bottom-width: 1px; > border-bottom-style: solid; > border-bottom-color: #000000; > > repeat for top and sides... > > Gary > "snapply" <webforumsuser@macromedia.com> wrote in message > news:gcbk84$1s2$1@forums.macromedia.com... >> Good evening, >> >> I am trying to add css to a table but not having any luck at all. I need >> to be >> able to add a 1px black border around it .The cells should align to the >> top and >> I need to change the table row colors, so one row would be one color and >> the >> next a different one. I just can't figure it out. Any help would be >> great. I >> am using an internal style sheet. >> Thank you. Here is my table code. >> >> <body> >> <table border="0" cellspacing="0" cellpadding="0"> >> <tr> >> <td>text text text</td> >> <td> text text text</td> >> </tr> >> <tr> >> <td> text text text </td> >> <td> text text text </td> >> </tr> >> <tr> >> <td> text text text </td> >> <td><p> text text text </p></td> >> </tr> >> <tr> >> <td> text text text </td> >> <td> text text text </td> >> </tr> >> <tr> >> <td> text text text </td> >> <td> text text text </td> >> </tr> >> <tr> >> <td>text text text </td> >> <td> text text text </td> >> </tr> >> </table> >> >> </body> >> </html> >> >> >> >> > > |
|
|||
|
Tim, I think you forgot
tr.evenrow td :-) -- Walt "TC2112" <nospam@nospam.com> wrote in message news:gcbl70$31c$1@forums.macromedia.com... > Hello, > > How about something like this? > > <style type="text/css"> > <!-- > body { > margin: 0px; > padding: 0px; > } > #maintable { > border: 1px solid #000; > background-color:#FFFFCC; > } > #maintable td { > vertical-align:top; > } > #maintable p { > margin: 0px; > } > tr.oddrow td{ > background-color:#6699FF; > } > --> > </style> > </head> > > <body> > <table cellpadding="0" cellspacing="0" id="maintable"> > <tr class="oddrow"> > <td>text text text</td> > <td>text text text</td> > </tr> > <tr> > <td>text text text </td> > <td>text text text </td> > </tr> > <tr class="oddrow"> > <td> text text text </td> > <td><p>text text text</p></td> > </tr> > <tr> > <td>text text text </td> > <td>text text text </td> > </tr> > <tr class="oddrow"> > <td>text text text </td> > <td>text text text </td> > </tr> > <tr> > <td>text text text </td> > <td>text text text </td> > </tr> > </table> > </body> > </html> > > > > Vertical align top won't work in IE5 for mac, but if you want to code for > that one you can just add valign="top" to each td. > > Take care, > Tim > > > "snapply" <webforumsuser@macromedia.com> wrote in message > news:gcbk84$1s2$1@forums.macromedia.com... >> Good evening, >> >> I am trying to add css to a table but not having any luck at all. I need >> to be >> able to add a 1px black border around it .The cells should align to the >> top and >> I need to change the table row colors, so one row would be one color and >> the >> next a different one. I just can't figure it out. Any help would be >> great. I >> am using an internal style sheet. >> Thank you. Here is my table code. >> >> <body> >> <table border="0" cellspacing="0" cellpadding="0"> >> <tr> >> <td>text text text</td> >> <td> text text text</td> >> </tr> >> <tr> >> <td> text text text </td> >> <td> text text text </td> >> </tr> >> <tr> >> <td> text text text </td> >> <td><p> text text text </p></td> >> </tr> >> <tr> >> <td> text text text </td> >> <td> text text text </td> >> </tr> >> <tr> >> <td> text text text </td> >> <td> text text text </td> >> </tr> >> <tr> >> <td>text text text </td> >> <td> text text text </td> >> </tr> >> </table> >> >> </body> >> </html> >> >> >> >> > > |
|
|||
|
My bad. Now I see you have odd rows with a class and the even rows with no
class. That's the thing about most rows, they have no class. -- Walt "Walt F. Schaefer" <walt@waltswebworx.com> wrote in message news:gcbmvs$54o$1@forums.macromedia.com... > Tim, I think you forgot > tr.evenrow td > > :-) > > -- > > Walt > > > "TC2112" <nospam@nospam.com> wrote in message > news:gcbl70$31c$1@forums.macromedia.com... >> Hello, >> >> How about something like this? >> >> <style type="text/css"> >> <!-- >> body { >> margin: 0px; >> padding: 0px; >> } >> #maintable { >> border: 1px solid #000; >> background-color:#FFFFCC; >> } >> #maintable td { >> vertical-align:top; >> } >> #maintable p { >> margin: 0px; >> } >> tr.oddrow td{ >> background-color:#6699FF; >> } >> --> >> </style> >> </head> >> >> <body> >> <table cellpadding="0" cellspacing="0" id="maintable"> >> <tr class="oddrow"> >> <td>text text text</td> >> <td>text text text</td> >> </tr> >> <tr> >> <td>text text text </td> >> <td>text text text </td> >> </tr> >> <tr class="oddrow"> >> <td> text text text </td> >> <td><p>text text text</p></td> >> </tr> >> <tr> >> <td>text text text </td> >> <td>text text text </td> >> </tr> >> <tr class="oddrow"> >> <td>text text text </td> >> <td>text text text </td> >> </tr> >> <tr> >> <td>text text text </td> >> <td>text text text </td> >> </tr> >> </table> >> </body> >> </html> >> >> >> >> Vertical align top won't work in IE5 for mac, but if you want to code for >> that one you can just add valign="top" to each td. >> >> Take care, >> Tim >> >> >> "snapply" <webforumsuser@macromedia.com> wrote in message >> news:gcbk84$1s2$1@forums.macromedia.com... >>> Good evening, >>> >>> I am trying to add css to a table but not having any luck at all. I need >>> to be >>> able to add a 1px black border around it .The cells should align to the >>> top and >>> I need to change the table row colors, so one row would be one color and >>> the >>> next a different one. I just can't figure it out. Any help would be >>> great. I >>> am using an internal style sheet. >>> Thank you. Here is my table code. >>> >>> <body> >>> <table border="0" cellspacing="0" cellpadding="0"> >>> <tr> >>> <td>text text text</td> >>> <td> text text text</td> >>> </tr> >>> <tr> >>> <td> text text text </td> >>> <td> text text text </td> >>> </tr> >>> <tr> >>> <td> text text text </td> >>> <td><p> text text text </p></td> >>> </tr> >>> <tr> >>> <td> text text text </td> >>> <td> text text text </td> >>> </tr> >>> <tr> >>> <td> text text text </td> >>> <td> text text text </td> >>> </tr> >>> <tr> >>> <td>text text text </td> >>> <td> text text text </td> >>> </tr> >>> </table> >>> >>> </body> >>> </html> >>> >>> >>> >>> >> >> > > |
|
|||
|
You might be able to just apply the CSS to the table, not sure, but it makes
more sense to name it, then apply or create the CSS "snapply" <webforumsuser@macromedia.com> wrote in message news:gcbn90$5g1$1@forums.macromedia.com... > Thank you for your help. So I have to name the table first? |
|
|||
|
No class, and they're stealing the bg color from the table ;-)
"Walt F. Schaefer" <walt@waltswebworx.com> wrote in message news:gcbue6$dta$1@forums.macromedia.com... > My bad. Now I see you have odd rows with a class and the even rows with no > class. > > That's the thing about most rows, they have no class. > > -- > > Walt > > > "Walt F. Schaefer" <walt@waltswebworx.com> wrote in message > news:gcbmvs$54o$1@forums.macromedia.com... >> Tim, I think you forgot >> tr.evenrow td >> >> :-) >> >> -- >> >> Walt >> >> >> "TC2112" <nospam@nospam.com> wrote in message >> news:gcbl70$31c$1@forums.macromedia.com... >>> Hello, >>> >>> How about something like this? >>> >>> <style type="text/css"> >>> <!-- >>> body { >>> margin: 0px; >>> padding: 0px; >>> } >>> #maintable { >>> border: 1px solid #000; >>> background-color:#FFFFCC; >>> } >>> #maintable td { >>> vertical-align:top; >>> } >>> #maintable p { >>> margin: 0px; >>> } >>> tr.oddrow td{ >>> background-color:#6699FF; >>> } >>> --> >>> </style> >>> </head> >>> >>> <body> >>> <table cellpadding="0" cellspacing="0" id="maintable"> >>> <tr class="oddrow"> >>> <td>text text text</td> >>> <td>text text text</td> >>> </tr> >>> <tr> >>> <td>text text text </td> >>> <td>text text text </td> >>> </tr> >>> <tr class="oddrow"> >>> <td> text text text </td> >>> <td><p>text text text</p></td> >>> </tr> >>> <tr> >>> <td>text text text </td> >>> <td>text text text </td> >>> </tr> >>> <tr class="oddrow"> >>> <td>text text text </td> >>> <td>text text text </td> >>> </tr> >>> <tr> >>> <td>text text text </td> >>> <td>text text text </td> >>> </tr> >>> </table> >>> </body> >>> </html> >>> >>> >>> >>> Vertical align top won't work in IE5 for mac, but if you want to code >>> for that one you can just add valign="top" to each td. >>> >>> Take care, >>> Tim >>> >>> >>> "snapply" <webforumsuser@macromedia.com> wrote in message >>> news:gcbk84$1s2$1@forums.macromedia.com... >>>> Good evening, >>>> >>>> I am trying to add css to a table but not having any luck at all. I >>>> need to be >>>> able to add a 1px black border around it .The cells should align to the >>>> top and >>>> I need to change the table row colors, so one row would be one color >>>> and the >>>> next a different one. I just can't figure it out. Any help would be >>>> great. I >>>> am using an internal style sheet. >>>> Thank you. Here is my table code. >>>> >>>> <body> >>>> <table border="0" cellspacing="0" cellpadding="0"> >>>> <tr> >>>> <td>text text text</td> >>>> <td> text text text</td> >>>> </tr> >>>> <tr> >>>> <td> text text text </td> >>>> <td> text text text </td> >>>> </tr> >>>> <tr> >>>> <td> text text text </td> >>>> <td><p> text text text </p></td> >>>> </tr> >>>> <tr> >>>> <td> text text text </td> >>>> <td> text text text </td> >>>> </tr> >>>> <tr> >>>> <td> text text text </td> >>>> <td> text text text </td> >>>> </tr> >>>> <tr> >>>> <td>text text text </td> >>>> <td> text text text </td> >>>> </tr> >>>> </table> >>>> >>>> </body> >>>> </html> >>>> >>>> >>>> >>>> >>> >>> >> >> > > |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise