Jump to content

Archived

This topic is now archived and is closed to further replies.

Endrew

style doesn't work!

Recommended Posts

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

Share this post


Link to post
Share on other sites
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">

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
You're close. Aside from forgetting to specify cellspacing="0", cellpadding="0", and border="0", you're good.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.