Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > HTML, XHTML and CSS

Reply
 
LinkBack Thread Tools
Old May 18th, 2006, 06:54 AM   #1
WebForumz Member
 

Join Date: Jul 2005
Location: uk
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 cyberseed is on a distinguished road
Post styles on tables

When applying a style to a table is it better to do it as a table id or just use class. Want to have different style tables so dont want to redefine the table tag. Do id's need to be unique when on the same page.

I am using Dreamweaver studio 8 and on the drop down you can only choose an id once on that page. Can duplicate the id if I use code though. I know most people just use divs but I am still not confident enough to utilise the benefits yet. There seem to be cross brower pitfalls and layout problems particularly with Dreamweaver.

Any advice, yes please!!
cyberseed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 18th, 2006, 07:09 AM   #2
WebForumz Member
 

Join Date: Apr 2006
Location: Missouri
Age: 33
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 lesleindotcom will become famous soon enough
Re: styles on tables

Yes you should use ids once per page

If you need help for a bit to use DIV tags you can use these here to get you started.
http://www.oswd.org
http://www.openwebdesign.org
http://blog.html.it/layoutgala/
lesleindotcom is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 18th, 2006, 07:10 AM   #3
New Member
 

Join Date: May 2006
Location: Northampton
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Dotty is on a distinguished road
Re: styles on tables

You're right. To go through validation, id's should only be used once so use classes. Add your classes to the TR or TD tags to change the formatting style.
Dotty is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 18th, 2006, 07:48 AM   #4
WebForumz Member
 

Join Date: Jul 2005
Location: uk
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 cyberseed is on a distinguished road
Re: styles on tables

Quote:
Originally Posted by Dotty
Add your classes to the TR or TD tags to change the formatting style.
Thats good if you want to style all elements in all tables but what if you want more than one table style.

In the past when I have wanted more than one table style instead of using
Code:
TABLE TR TD
which affects all tables or contents, I have created a style e.g. .table01 - .table02 etc then applied the style using class e.g.
Code:
<table width="758" border="0" align="center" cellpadding="0" cellspacing="0" class="table01">
Would it be better to break it up and have additional styles like:
td.table01
tr.table02

Or is there a better way
cyberseed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 18th, 2006, 07:55 AM   #5
Highly Reputable Member
 
herkalees's Avatar
 

Join Date: Jul 2005
Location: Massachusetts, USA
Age: 89
Posts: 563
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 herkalees will become famous soon enough herkalees will become famous soon enough
Re: styles on tables

You can use ID's all over the place only if they're used once per page. Classes can be used twice, or more, per page.

For instance:

You cannot have this on the same page:

<table id="blue">
<tr>
<td>some information</td>
</tr>
</table>

<table id="blue">
<tr>
<td>other information</td>
</tr>
</table>

But you can have this:

<table class="blue">
<tr>
<td>some information</td>
</tr>
</table>

<table class="blue">
<tr>
<td>other information</td>
</tr>
</table>
herkalees is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 18th, 2006, 07:56 AM   #6
WebForumz Member
 

Join Date: Jul 2005
Location: uk
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 cyberseed is on a distinguished road
Re: styles on tables

Thanks but I am still nervous about cross browser issues using divs particularly when using complex layouts where you float them. Have just read the article on Tables vs CSS-P Poll in this forum http://www.webforumz.com/html-forum/...css-p-poll.htm and I can see I am not the only person having doubts, although I am intrigued by the possibilities.
cyberseed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 18th, 2006, 07:58 AM   #7
WebForumz Member
 

Join Date: Jul 2005
Location: uk
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 cyberseed is on a distinguished road
Re: styles on tables

thanks for everyones help
cyberseed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 18th, 2006, 08:03 AM   #8
Highly Reputable Member
 
herkalees's Avatar
 

Join Date: Jul 2005
Location: Massachusetts, USA
Age: 89
Posts: 563
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 herkalees will become famous soon enough herkalees will become famous soon enough
Re: styles on tables

Quote:
Originally Posted by cyberseed
Thanks but I am still nervous about cross browser issues using divs particularly when using complex layouts where you float them. Have just read the article on Tables vs CSS-P Poll in this forum http://www.webforumz.com/html-forum/...css-p-poll.htm and I can see I am not the only person having doubts, although I am intrigued by the possibilities.
Don't be nervous, I've made cross-browser layouts using floated div's that would be near impossible with tables.

This, for instance: http://amsa.digitalbungalow.com/amsa/bor/highschool/

[edit] Seems like my development server at work is temporarily buggy, check that link later
herkalees is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 18th, 2006, 08:16 AM   #9
WebForumz Member
 

Join Date: Jul 2005
Location: uk
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 cyberseed is on a distinguished road
Re: styles on tables

Quote:
Originally Posted by herkalees
Don't be nervous, I've made cross-browser layouts using floated div's that would be near impossible with tables.

This, for instance: http://amsa.digitalbungalow.com/amsa/bor/highschool/

[edit] Seems like my development server at work is temporarily buggy, check that link later
Thanks, there seems to be a steep learning curve with complex layouts especially when I have got used to working with tables. Have done some good tutorials but there seems to be alot of unresolved issues and lots of dis-information. Tables are very time consuming so I can see the advantages of having a more liquid layout. Dreamweaver studio 8 doesnt seem to display some code correctly too with divs.
Will look at link latter.
Ta
cyberseed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 18th, 2006, 02:50 PM   #10
Highly Reputable Member
 
herkalees's Avatar
 

Join Date: Jul 2005
Location: Massachusetts, USA
Age: 89
Posts: 563
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 herkalees will become famous soon enough herkalees will become famous soon enough
Re: styles on tables

Quote:
Originally Posted by cyberseed
Dreamweaver studio 8 doesnt seem to display some code correctly too with divs.
Yeah, don't bother previewing in Design View, it stinks. Just preview in browser (F12 I think) or do the 'ol upload-and-refresh in a browser.
herkalees is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 23rd, 2006, 11:02 AM   #11
Highly Reputable Member
 
masonbarge's Avatar
 

Join Date: Jan 2006
Location: Atlanta GA
Posts: 649
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 masonbarge will become famous soon enough
Re: styles on tables

You can open the page as a file in any browser and bookmark it. You can have as many browsers open as you want, although I've had problems trying to keep more than one version of IE.
masonbarge is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 23rd, 2006, 12:25 PM   #12
Most Reputable Member
SuperMember
 
minute44's Avatar
 

Join Date: Apr 2006
Location: Nottingham UK
Age: 26
Posts: 1,406
Blog Entries: 3
Thanks: 0
Thanked 1 Time in 1 Post
Rep Altering Power: 0 minute44 is just really nice minute44 is just really nice minute44 is just really nice minute44 is just really nice
Re: styles on tables

Quote:
Originally Posted by cyberseed
When applying a style to a table is it better to do it as a table id or just use class.
Answer: Don't use Tables... I only ever use them when displaying Tabular data such as opening times and price lists.
minute44 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 23rd, 2006, 12:34 PM   #13
WebForumz Member
 

Join Date: Nov 2005
Location: England
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 iZone will become famous soon enough
Re: styles on tables

check out Layout Gala: a collection of 40 CSS layouts based on the same markup and ready for download! to get you started with cross-browser compliant css layouts.
iZone is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
styles , tables


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
IE6 Ignoring some styles but IE7 works fine?? swillicott HTML, XHTML and CSS 4 May 14th, 2008 07:35 AM
CSS conflicting styles ttaxi HTML, XHTML and CSS 2 March 28th, 2008 01:01 PM
who wants to talk about css print styles? PixelLuv HTML, XHTML and CSS 4 July 14th, 2006 10:51 AM
Styles in classes? timmytots HTML, XHTML and CSS 4 December 1st, 2005 09:20 PM
Need Help with styles and where to start on this mess... EAndrews HTML, XHTML and CSS 10 November 7th, 2005 04:46 PM


Search Engine Optimization by vBSEO 3.2.0 RC8