Adobe Dreamweaver Forums



Last 10 THreads :         Problem with navigateToURL to a certain frame (Last Post : Ibsie - Replies : 0 - Views : 1 )           »          html view - how to wrap the text (Last Post : lmckh - Replies : 1 - Views : 2 )           »          Help! Prob with CSS display (Last Post : hnajskmei - Replies : 0 - Views : 1 )           »          DW help urgently needed, lost my connection to site (Last Post : Ronnie MacGregor - Replies : 11 - Views : 12 )           »          Connecting to a Database (Last Post : Ronnie MacGregor - Replies : 11 - Views : 12 )           »          application.cfm/webservice (Last Post : BKBK - Replies : 1 - Views : 2 )           »          Random positions for Movieclips (Last Post : arnhemcs - Replies : 4 - Views : 8 )           »          Generating LEGAL size Word doc (Last Post : BKBK - Replies : 2 - Views : 3 )           »          This Tough Economy and Flex/AIR (Last Post : LuigiL - Replies : 2 - Views : 109 )           »          Fireworks images seem jaggy or kind of blurry (Last Post : azmatswabi - Replies : 5 - Views : 7 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Dreamweaver: Main > Dreamweaver General
 
Tags:



Reply
  #1 (permalink)  
Old 10-06-2008, 01:03 AM
snapply
 
Posts: n/a
Diggs:
Default applying css to a table

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>






Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-06-2008, 01:16 AM
GPaul
 
Posts: n/a
Diggs:
Default Re: applying css to a table

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>
>
>
>
>



Reply With Quote
  #3 (permalink)  
Old 10-06-2008, 01:16 AM
TC2112
 
Posts: n/a
Diggs:
Default Re: applying css to a table

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>
>
>
>
>



Reply With Quote


  #4 (permalink)  
Old 10-06-2008, 01:25 AM
TC2112
 
Posts: n/a
Diggs:
Default Re: applying css to a table

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>
>>
>>
>>
>>

>
>



Reply With Quote
  #5 (permalink)  
Old 10-06-2008, 01:53 AM
Walt F. Schaefer
 
Posts: n/a
Diggs:
Default Re: applying css to a table

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>
>>
>>
>>
>>

>
>



Reply With Quote
  #6 (permalink)  
Old 10-06-2008, 01:53 AM
snapply
 
Posts: n/a
Diggs:
Default Re: applying css to a table

Thank you for your help. So I have to name the table first?
Reply With Quote


  #7 (permalink)  
Old 10-06-2008, 03:53 AM
Walt F. Schaefer
 
Posts: n/a
Diggs:
Default Re: applying css to a table

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>
>>>
>>>
>>>
>>>

>>
>>

>
>



Reply With Quote
  #8 (permalink)  
Old 10-06-2008, 12:25 PM
GPaul
 
Posts: n/a
Diggs:
Default Re: applying css to a table

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?



Reply With Quote
  #9 (permalink)  
Old 10-06-2008, 03:34 PM
Walt F. Schaefer
 
Posts: n/a
Diggs:
Default Re: applying css to a table

>>So I have to name the table first?

No!

--

Walt


"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?



Reply With Quote


  #10 (permalink)  
Old 10-07-2008, 01:43 AM
TC2112
 
Posts: n/a
Diggs:
Default Re: applying css to a table

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>
>>>>
>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



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
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 12:37 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk