Jump to content


Photo

style doesn't work!


  • Please log in to reply
4 replies to this topic

#1 Endrew

Endrew
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 31 May 2006 - 03:50 AM

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
table.sheet
{
border: solid;
padding: 5px;
border-color: rgb(0,0,0);
border-collapse: collapse;
border-width: 1px;
width: 766px;
}
[/quote]

Hello,
I'm having problems applying this definition to my table. Padding isn't working. For border-color, the inner lines are still grey color. Is there anyway to fix this?
Thnx

#2 moberemk

moberemk
  • Members
  • PipPipPip
  • Advanced Member
  • 695 posts

Posted 31 May 2006 - 11:16 AM

Can you give us the table code? For CSS table styling, we try to use this:
<table cellpadding="0" cellspacing="0" border="0" class="classname">
Disclaimer: No matter how harsh I may be, I'm always IMO only.

#3 Endrew

Endrew
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 31 May 2006 - 05:17 PM

I have different types of tables in my page. So I use class to solve my problem.

My code example is
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
<style type="text/css">
table.rect
{
background-color: rgb(245,233,217);
border: solid;
border-color: rgb(10,20,35);
border-width: 1px;
min-width: 776px;
}

table.sheet
{
border: solid;
padding: 5px;
border-color: rgb(0,0,0);
border-collapse: collapse;
border-width: 1px;
width: 766px;
}

</style>

<table border = "1" class = "sheet">
<tr>
<td >........</td>
</tr>
</table>

<table border = "1" class = "rect">
<tr>
<td >........</td>
</tr>
</table>

[/quote]

I'm quite new to CSS. I don't know whether this implementation is right or wrong. Thanks for ur reply.

#4 moberemk

moberemk
  • Members
  • PipPipPip
  • Advanced Member
  • 695 posts

Posted 31 May 2006 - 09:00 PM

You're close. Aside from forgetting to specify cellspacing="0", cellpadding="0", and border="0", you're good.
Disclaimer: No matter how harsh I may be, I'm always IMO only.

#5 king arthur

king arthur
  • Members
  • PipPipPip
  • Advanced Member
  • 335 posts
  • LocationUK HQ

Posted 02 June 2006 - 08:54 AM

You might find you need to apply some of those style attributes to the table cells themselves to get what you want. Also, try looking at it in different browsers as this is one area in which IE and Firefox have annoying differences!
Sir Isaac Newton said "If I have seen farther, it is by standing on the shoulders of giants". But it is not recorded as to whether he said it before or after he was hit on the head by a falling apple.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users