homepage Welcome to WebmasterWorld Guest from 54.197.189.108
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Tables: validator says I cannot use the ID more than once
frisso




msg:610326
 3:40 pm on May 4, 2005 (gmt 0)

I have a few tables on my website i was using this code
<TABLE id=table1>
<TR>
<TD bgcolor="#8B0000">
text here
</TD>
</TR>
</TABLE>
But i want a few tables that are exactly the same so i just repeated the code but html validator says that i have to use a different id everytime

Is there another code which i can use instead of id?

 

encyclo




msg:610327
 3:45 pm on May 4, 2005 (gmt 0)

Welcome to WebmasterWorld [webmasterworld.com], frisso.

As the validator says, you can only use an id attribute once on a page. Depending on what you're using it for, you may be able to replace it with a class attribute, which can be used multiple times.

<TABLE [b]class[/b]="table1">

frisso




msg:610328
 4:06 pm on May 4, 2005 (gmt 0)

Thanks
but that is not working do i have to change the css for <table class="table1"> to work

zooloo




msg:610329
 4:18 pm on May 4, 2005 (gmt 0)

The prefix for class in your css is different to id.

IE. #table1 and/or .table1

wickydoodah




msg:610330
 6:34 pm on May 4, 2005 (gmt 0)

frisso...

I believe the "id=table1" code you're referring to is the table ID that editors such as Frontpage automatically insert when creating a new table. It's not related to CSS styling. Since you did a copy-and-paste to duplicate the table, you either need to change the ID number for each copied table to something unique (eg: "id=table2", "id=table3", etc.), or you can possibly get rid of the ID's all together. Try changing the ID's for the copied tables and revalidate... it should work then.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved