Small php table

This is a discussion on "Small php table" within the PHP Forum section. This forum, and the thread "Small php table are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Mar 1st, 2008, 23:00
Oak's Avatar
Oak Oak is offline
SuperMember

SuperMember
Join Date: Dec 2007
Location: London
Age: 35
Posts: 304
Thanks: 6
Thanked 0 Times in 0 Posts
Small php table

My table displays correctly in IE and not in FF?


http://www.capoeiracanal.co.uk/index-classes.php



Last edited by Oak; Mar 2nd, 2008 at 17:56.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Mar 2nd, 2008, 11:33
Oak's Avatar
Oak Oak is offline
SuperMember

SuperMember
Join Date: Dec 2007
Location: London
Age: 35
Posts: 304
Thanks: 6
Thanked 0 Times in 0 Posts
Re: Small php table

Should I have posted this in php section?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Mar 2nd, 2008, 11:57
Ed Ed is online now
Moderator
Join Date: Jul 2007
Location: Cork, Ireland
Posts: 730
Blog Entries: 1
Thanks: 0
Thanked 1 Time in 1 Post
Re: Small php table

Yes.

Moved to PHP Forum.
Last Blog Entry: Happy New Year! (Dec 31st, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Mar 3rd, 2008, 10:07
Oak's Avatar
Oak Oak is offline
SuperMember

SuperMember
Join Date: Dec 2007
Location: London
Age: 35
Posts: 304
Thanks: 6
Thanked 0 Times in 0 Posts
Re: Small php table

Any ideas?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Mar 3rd, 2008, 10:32
Marc's Avatar
Staff Manager

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Posts: 1,777
Thanks: 0
Thanked 15 Times in 15 Posts
Re: Small php table

What table are you on about? I don't see any differences!
__________________
Marc
Staff Manager - Webforumz.com


Want to be a moderator? PM me.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Mar 3rd, 2008, 11:11
Oak's Avatar
Oak Oak is offline
SuperMember

SuperMember
Join Date: Dec 2007
Location: London
Age: 35
Posts: 304
Thanks: 6
Thanked 0 Times in 0 Posts
Re: Small php table

Top image is FF

Bottom is IE7
Attached Images
File Type: jpg tablescreen-sht.jpg (71.4 KB, 9 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Mar 3rd, 2008, 13:09
Junior Member
Join Date: Sep 2007
Location: uk
Age: 32
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Small php table

I have seen this a few times before and have fixed it by adding cellspacing to the table tag in the HTML code and border-spacing to the CSS code as shown below:

<table class="indexpage" cellspacing="5px">

.indexpage {
border-spacing: 5px;
}

Doing this seems to make it work on all browsers.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Mar 3rd, 2008, 14:08
Oak's Avatar
Oak Oak is offline
SuperMember

SuperMember
Join Date: Dec 2007
Location: London
Age: 35
Posts: 304
Thanks: 6
Thanked 0 Times in 0 Posts
Re: Small php table

before
HTML: Select all
<br /><table id="timetable1" border="0" cellspacing="2" width="445px">
after
HTML: Select all
<table class="indexpage" cellspacing="5px" id="timetable1" border="0" width="445px">
Still only works in IE not in FF!

Last edited by Oak; Mar 3rd, 2008 at 14:11.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Mar 3rd, 2008, 15:44
Junior Member
Join Date: Sep 2007
Location: uk
Age: 32
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Small php table

You now have an id and a class in your HTML table tag, you need to have one or the other. Try removing class="indexpage" from the table tag and adding border-spacing: 5px; to the timetable1 class in your CSS code.

Last edited by kerrsmith; Mar 3rd, 2008 at 15:47.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Mar 3rd, 2008, 16:53
Jack Franklin's Avatar
Moderator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,404
Blog Entries: 8
Thanks: 18
Thanked 14 Times in 14 Posts
Re: Small php table

Quote:
Originally Posted by kerrsmith View Post
You now have an id and a class in your HTML table tag, you need to have one or the other. Try removing class="indexpage" from the table tag and adding border-spacing: 5px; to the timetable1 class in your CSS code.
1 element with an id and class is perfectly acceptable.
__________________
Jack Franklin - Webforumz Moderator
(x)HTML | CSS | PHP | MySQL | JQuery (Javascript)
Contact: My Blog | Twitter | Delicious
Want Lessons? PM me.
If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Mar 3rd, 2008, 21:47
Junior Member
Join Date: Sep 2007
Location: uk
Age: 32
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Small php table

Yes, although you can use both id and class within an single element in this particular case it is not really necessary - it makes sense just to add the required code to the id already created in the CSS code - if only to keep the code neat and tidy.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Mar 4th, 2008, 09:44
Oak's Avatar
Oak Oak is offline
SuperMember

SuperMember
Join Date: Dec 2007
Location: London
Age: 35
Posts: 304
Thanks: 6
Thanked 0 Times in 0 Posts
Re: Small php table

Quote:
Try removing class="indexpage" from the table tag and adding border-spacing: 5px; to the timetable1 class in your CSS code.
Still not working.

HTML: Select all
<table id="timetable1" cellspacing="2" width="445px">

#timetable1 th
{
background: #ccc;
padding: 5px;
text-align: left;
border-spacing: 5px;
}
#timetable1 td
{
border-spacing: 5px;
background: #E2E4E7;
padding: 5px;
text-align: left;
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Mar 4th, 2008, 10:11
Junior Member
Join Date: Sep 2007
Location: uk
Age: 32
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Small php table

You need to apply border-spacing to the whole table not just the th and td tags. Try adding the following to your CSS code:

#timetable1
{
border-spacing: 5px;
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
Old Mar 4th, 2008, 10:18
Oak's Avatar
Oak Oak is offline
SuperMember

SuperMember
Join Date: Dec 2007
Location: London
Age: 35
Posts: 304
Thanks: 6
Thanked 0 Times in 0 Posts
Re: Small php table

Nope, still no good.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #15  
Old Mar 4th, 2008, 11:27
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,184
Blog Entries: 7
Thanks: 27
Thanked 21 Times in 18 Posts
Re: Small php table

ok, back to basics here:-

Define you table as such:-
Code: Select all
<table cellpadding="0" cellspacing="0" id="timetable1">
This HAS TO work in all browsers because it's basic HTML. Not all browsers have the same default cellpadding and cellspacing behaviour so it's best to explicitly define it.

If you need padding in cells and spacing between them, then define it in the CSS.
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #16  
Old Mar 4th, 2008, 12:34
Oak's Avatar
Oak Oak is offline
SuperMember

SuperMember
Join Date: Dec 2007
Location: London
Age: 35
Posts: 304
Thanks: 6
Thanked 0 Times in 0 Posts
Re: Small php table

Rob, This still did not create any spacing.

HTML: Select all
<table cellpadding="0" cellspacing="0" id="timetable1" >
#timetable1 th
{
background: #ccc;
padding: 5px;
text-align: left;
border-spacing: 5px;
cell-spacing: 2px;
width:445px
}
#timetable1 td
{
border-spacing: 5px;
background: #E2E4E7;
padding: 5px;
text-align: left;
cell-spacing: 2px;
width:445px
}
#timetable1
{
border-spacing: 5px;
cell-spacing: 2px;
width:445px }
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #17  
Old Mar 4th, 2008, 12:39
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Small php table

To me, this is an HTML or CSS question Luckily, as everyone knows, PHP geeks are top experts in every field, including dating and auto repair.

The solution here is simple: Don't use an html table. All you have here is a large box with two styles of a smaller box inside. The CSS is so basic I won't even bother to do sample code.

RANT WARNING!

HTML tables are on the way out. They usually don't save time in the long run during coding, they add processing overhead, and as your problem shows, browser implementation is quirky and even horrific. Improving table rendering is a very low priority for the besieged browser industry so don't expect it to improve much.

There might be reasons to use them in the short run: better valign support, features you already know and don't want to take the time to reproduce in CSS (like colgroup), or an existing import function from another code source might be three. But most likely these will slowly disappear.

Now, if we could just code form elements.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #18  
Old Mar 4th, 2008, 12:44
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,184
Blog Entries: 7
Thanks: 27
Thanked 21 Times in 18 Posts
Re: Small php table

Mason, oak is trying to display tabular data. The need for a table in this instance is not only self evident, but highly reccomended -especially when done properly with table headers.


Oak, are you saying you actually want spacing between cells?
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #19  
Old Mar 4th, 2008, 12:46
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,184
Blog Entries: 7
Thanks: 27
Thanked 21 Times in 18 Posts
Re: Small php table

You were using WAY to much code....

Try:---

HTML: Select all
<table cellpadding="5" cellspacing="5" id="timetable1" ></