SourceTec Software

It is currently Thu Apr 24, 2014 10:28 pm

All times are UTC + 8 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Jun 03, 2013 3:14 am 
Offline
Member

Joined: Mon Feb 04, 2008 6:40 am
Posts: 17
I'm having a problem when trying to make my website apply to the WC3 validator.

I have been using <table width="100%" cellpadding="0" cellspacing="0"> on all my websites to set passing and spacing to 0, but WC3 telles me this is old fashion and want me to use CSS.

When I use this:
table
{
border-collapse: collapse;
}
th, td
{
padding: 0;
}

The borders and padding in my menu also disapairs :/ Is there any way to prevent this from happening?

I have uploaded a Before/After picture here, http://tinypic.com/r/24v4ifd/5


Top
 Profile  
 
PostPosted: Mon Jun 03, 2013 9:16 am 
Offline
Guru
User avatar

Joined: Mon May 10, 2004 3:53 am
Posts: 1752
Location: Rescue, CA, USA
As you discovered, table tags in a stylesheet can cause problems because DHTML Menu uses tables internally. The best solution is to use DIVs and CSS for layout instead of tables. However, if you want to continue to use tables, <table width="100%" cellpadding="0" cellspacing="0"> is valid code. I'm not sure which DOCTYPE you are using, but try placing the following at the very top of your page instead of any DOCTYPE you might have been using:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

You can see an example at http://bestwebmenu.com/tables/index.html and the W3C Markup Validation Service says, "This document was successfully checked as XHTML 1.0 Transitional!"

EDIT: I just thought of something... If you're using HTML instead of XHTML the DOCTYPE I suggested will generate all sorts of validation errors. If you're using HTML, please substitute the following DOCTYPE for the one I suggested:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


Regards,

Bill
Unofficial DHTML Menu Resource Site


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 8 hours


Who is online

Users browsing this forum: Google [Bot] and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group