[SOLVED] HTML 5 and Tables - Ugh!!!!!!!!!!!!

For general web development questions that are not specifically related to CSS HTML Validator. This includes (but is not limited to) general HTML, CSS, Accessibility, JavaScript, and SEO questions.
Post Reply
paulp575
Rank IV - Intermediate
Posts: 170
Joined: Tue Aug 09, 2005 1:20 pm
Location: Spokane WA
Contact:

[SOLVED] HTML 5 and Tables - Ugh!!!!!!!!!!!!

Post by paulp575 »

Trying to update my personal web pages to HTML 5 and getting errors with a table that needs to have a border.

Not sure what's going on, but the specific problem is on the military.htm page - the table is "Unit Assignments" table.
I need to have lines in the table and want a cellpadding of 5 and a cellspacing of 0.

Help!!!!!!!!
Attachments
Paul Yelk New web Pages.zip
(465.71 KiB) Downloaded 228 times
Last edited by paulp575 on Tue Aug 24, 2021 4:38 pm, edited 1 time in total.
paulp575
User avatar
Albert Wiersch
Site Admin
Posts: 3783
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: HTML 5 and Tables - Ugh!!!!!!!!!!!!

Post by Albert Wiersch »

Hi Paul,

I took a look at the table you mentioned. Try changing this:

Code: Select all

<table cellpadding="5" cellspacing="0" border="1" class="TABLE-CENTERED">
to this:

Code: Select all

<table id="unitassignments" class="TABLE-CENTERED">
Then adding this CSS to the page's styles:

Code: Select all

table#unitassignments { border-collapse: collapse; }
table#unitassignments td { padding: .3em; border: 2px solid black; }
It should give the table a similar look to using the obsolete "border", "cellpadding", and "cellspacing" HTML attributes.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
paulp575
Rank IV - Intermediate
Posts: 170
Joined: Tue Aug 09, 2005 1:20 pm
Location: Spokane WA
Contact:

Re: HTML 5 and Tables - Ugh!!!!!!!!!!!!

Post by paulp575 »

Thanks.

Appreciate the corrections.
paulp575
Post Reply