|
|
 |
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
|
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!!
|
|
|
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
|
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.
|
|
|
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
|
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
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
|
|
|
May 18th, 2006, 07:55 AM
|
#5
|
|
Highly Reputable Member
Join Date: Jul 2005
Location: Massachusetts, USA
Age: 89
Posts: 563
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
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>
|
|
|
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
|
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.
|
|
|
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
|
Re: styles on tables
thanks for everyones help
|
|
|
May 18th, 2006, 08:03 AM
|
#8
|
|
Highly Reputable Member
Join Date: Jul 2005
Location: Massachusetts, USA
Age: 89
Posts: 563
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
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 
|
|
|
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
|
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 
|
|
|
May 18th, 2006, 02:50 PM
|
#10
|
|
Highly Reputable Member
Join Date: Jul 2005
Location: Massachusetts, USA
Age: 89
Posts: 563
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
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.
|
|
|
May 23rd, 2006, 11:02 AM
|
#11
|
|
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 649
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
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.
|
|
|
May 23rd, 2006, 12:25 PM
|
#12
|
|
Most Reputable Member
SuperMember
Join Date: Apr 2006
Location: Nottingham UK
Age: 26
Posts: 1,406
Thanks: 0
Thanked 1 Time in 1 Post
|
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.
|
|
|
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
|
Re: styles on tables
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
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 |
|