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.



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

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Mar 1st, 2008, 23:00
Oak Oak is offline
SuperMember

SuperMember
Join Date: Dec 2007
Location: London
Age: 35
Posts: 269
Thanks: 2
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.
Reply With Quote

  #2 (permalink)  
Old Mar 2nd, 2008, 11:33
Oak Oak is offline
SuperMember

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

Should I have posted this in php section?
Reply With Quote
  #3 (permalink)  
Old Mar 2nd, 2008, 11:57
Ed Ed is offline
Highly Reputable Member
Join Date: Jul 2007
Location: Cork, Ireland
Posts: 687
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Small php table

Yes.

Moved to PHP Forum.
Last Blog Entry: Happy New Year! (Dec 31st, 2007)
Reply With Quote
  #4 (permalink)  
Old Mar 3rd, 2008, 10:07
Oak Oak is offline
SuperMember

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

Any ideas?
Reply With Quote
  #5 (permalink)  
Old Mar 3rd, 2008, 10:32
Marc's Avatar
Moderator

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,650
Thanks: 0
Thanked 8 Times in 8 Posts
Send a message via MSN to Marc Send a message via Skype™ to Marc
Re: Small php table

What table are you on about? I don't see any differences!
Reply With Quote
  #6 (permalink)  
Old Mar 3rd, 2008, 11:11
Oak Oak is offline
SuperMember

SuperMember
Join Date: Dec 2007
Location: London
Age: 35
Posts: 269
Thanks: 2
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)
Reply With Quote
  #7 (permalink)  
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.
Reply With Quote
  #8 (permalink)  
Old Mar 3rd, 2008, 14:08
Oak Oak is offline
SuperMember

SuperMember
Join Date: Dec 2007
Location: London
Age: 35
Posts: 269
Thanks: 2
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.
Reply With Quote
  #9 (permalink)  
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.
Reply With Quote
  #10 (permalink)  
Old Mar 3rd, 2008, 16:53
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,268
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 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.
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote
  #11 (permalink)  
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.
Reply With Quote
  #12 (permalink)  
Old Mar 4th, 2008, 09:44
Oak Oak is offline
SuperMember

SuperMember
Join Date: Dec 2007
Location: London
Age: 35
Posts: 269
Thanks: 2
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;
}
Reply With Quote
  #13 (permalink)  
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;
}
Reply With Quote
  #14 (permalink)  
Old Mar 4th, 2008, 10:18
Oak Oak is offline
SuperMember

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

Nope, still no good.
Reply With Quote
  #15 (permalink)  
Old Mar 4th, 2008, 11:27
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
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.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #16 (permalink)  
Old Mar 4th, 2008, 12:34
Oak Oak is offline
SuperMember

SuperMember
Join Date: Dec 2007
Location: London
Age: 35
Posts: 269
Thanks: 2
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 }
Reply With Quote
  #17 (permalink)  
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.
Reply With Quote
  #18 (permalink)  
Old Mar 4th, 2008, 12:44
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
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?
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #19 (permalink)  
Old Mar 4th, 2008, 12:46
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Re: Small php table

You were using WAY to much code....

Try:---

HTML: Select all
<table cellpadding="5" cellspacing="5" id="timetable1" >
Code: Select all
#timetable1 th
{
background: #ccc;
}
#timetable1 td
{
background: #E2E4E7;
text-align: left;
}
#timetable1
{
width:445px }
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #20 (permalink)  
Old Mar 4th, 2008, 13:20
Oak Oak is offline
SuperMember

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

Quote:
The need for a table in this instance is not only self evident, but highly reccomended -especially when done properly with table headers.
Sorry but am I using table headers?

Quote:
Oak, are you saying you actually want spacing between cells?
Yes

Quote:
You were using WAY to much code.... try this.
Thanks.. FF still does not show spacing.
Reply With Quote
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
a small bug in IE geyids Web Page Design 8 Jan 20th, 2008 00:49
small css problem yoda Web Page Design 1 Mar 22nd, 2007 17:40
Need small help with pagination ofi PHP Forum 0 Feb 7th, 2007 11:44
Need to align width of Float table with the table below Vertabase Web Page Design 4 Mar 8th, 2006 21:21


All times are GMT. The time now is 06:02.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43