CSS- table margins-border

  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

hey,

i made a table class:

Code: [ Select ]
.maintable {
background-color: #FFFFFF;
border: 0px;
width: 100%;
padding-right: 0px;
border-spacing: 0px;
}
  1. .maintable {
  2. background-color: #FFFFFF;
  3. border: 0px;
  4. width: 100%;
  5. padding-right: 0px;
  6. border-spacing: 0px;
  7. }


thing is. when i preview it, theres a gap on each side of the table... meaning a margin maybe?! or a border?!

How can i overcome this..
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bobbo171
  • Graduate
  • Graduate
  • Bobbo171
  • Posts: 174

Post 3+ Months Ago

do you have a source that i could see?
  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

Code: [ Select ]
<table class="maincontent">
 <tr valign="top">
  <td colspan="2" align="left"> <table class="heading_top">
    <tr>
     <td height="86">&nbsp;</td>
  1. <table class="maincontent">
  2.  <tr valign="top">
  3.   <td colspan="2" align="left"> <table class="heading_top">
  4.     <tr>
  5.      <td height="86">&nbsp;</td>


This is the table around all the content on the page. It's a snippet.
  • Mr Smith
  • Graduate
  • Graduate
  • Mr Smith
  • Posts: 150
  • Loc: Birmingham, England

Post 3+ Months Ago

Nem,

i'm not quite sure what you mean, could you possibly post more code, or even a page where i can get a better idea of what you are trying to do (i.e what else is around the table etc.).....also, i'm not quite sure why you have 'border-spacing:0px;' in there.....the problem might go just by taking that out.

Joe
  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

I tried what you mentioned Mr Smith. Still does not work.
  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

Image

here is an example.... See the black table at the top? It is not right on the corner of the document...
  • Mr Smith
  • Graduate
  • Graduate
  • Mr Smith
  • Posts: 150
  • Loc: Birmingham, England

Post 3+ Months Ago

Nem,

hm, try allocating a width dimension in that class......also, where you have this code

Code: [ Select ]
<table class="maincontent">


add

Code: [ Select ]
<table class="maincontent" cellspacing="0">


this could be it......as IE uses a default cellspacing of 2 i think if you don't declare a prop for it.
  • Mr Smith
  • Graduate
  • Graduate
  • Mr Smith
  • Posts: 150
  • Loc: Birmingham, England

Post 3+ Months Ago

you mean you want all those links and the table below to all be 'next to each other' or 'touching' so to speak?

if so, then it's definitely a cellspacing thing.....try adding cellspacing="0" to each table tag.

Joe
  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

hm that solved it.

Maybe i should put

Code: [ Select ]
cellpadding: 0;


in the css instead of 0px.
  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

Fixed. Thanks for your help.
  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

hm.... the css isnt working.
  • Mr Smith
  • Graduate
  • Graduate
  • Mr Smith
  • Posts: 150
  • Loc: Birmingham, England

Post 3+ Months Ago

Nem,

you need to put the cellspacing and cellpadding in the HTML part of the page within the table tag, rather than putting it in the style......

rather than putting 'cellpadding', you just need put 'padding' in the css, that's prob why it isn't working

Joe

Post Information

  • Total Posts in this topic: 12 posts
  • Users browsing this forum: No registered users and 78 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.