Current location: Hot Scripts Forums » General Web Coding » CSS » margin in tables


margin in tables

Reply
  #1 (permalink)  
Old 11-13-06, 05:17 PM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
margin in tables

I was wondering how to set margins in a table cell.
i tried a simple css:
Code:
.test{ margin: 10px 10px 10px 30px;
}
and then my html:
Code:
<table border="1">
<tr>
  <td>blahblahblah</td>
  <td class="test">This is just some sample text</td>
</tr>
<tr>
  <td>blahblabhalvlahvlahvblah</td>
  <td>blahblabhalvlahvlahvblah</td>
</tr>
</table>
but this doesn't seem to work. Why? and does anybody knows a sollution?
when i use the same css on a p-element, it works fine

Thanx,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Reply With Quote
  #2 (permalink)  
Old 11-13-06, 11:24 PM
jfulton's Avatar
jfulton jfulton is offline
Community VIP
 
Join Date: Apr 2006
Location: Los Angeles, CA
Posts: 660
Thanks: 0
Thanked 0 Times in 0 Posts
Reply With Quote
  #3 (permalink)  
Old 11-14-06, 01:56 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
i've found it
i had to use padding, not margin. then it works just as i want it to.

Thanx anyway
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading from 2 tables alane Database 5 10-13-06 03:37 PM
CSS Rollover Problem in IE tjs CSS 4 08-30-06 11:29 AM
updating database tables when tables may or may not have changed? Tim Mousel PHP 0 05-21-06 05:25 PM
REQUEST: Tutorial or prmg on mysql/php/related tables chippewapublishing Script Requests 0 08-05-05 01:50 PM
script that measures height of tables and vertically aligns nested tables amj01 Script Requests 1 07-04-03 01:20 PM


All times are GMT -5. The time now is 01:57 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.