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!!!!!!!!
[SOLVED] HTML 5 and Tables - Ugh!!!!!!!!!!!!
-
- Rank IV - Intermediate
- Posts: 170
- Joined: Tue Aug 09, 2005 1:20 pm
- Location: Spokane WA
- Contact:
[SOLVED] HTML 5 and Tables - Ugh!!!!!!!!!!!!
- 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
- 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!!!!!!!!!!!!
Hi Paul,
I took a look at the table you mentioned. Try changing this:
to this:
Then adding this CSS to the page's styles:
It should give the table a similar look to using the obsolete "border", "cellpadding", and "cellspacing" HTML attributes.
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">
Code: Select all
<table id="unitassignments" class="TABLE-CENTERED">
Code: Select all
table#unitassignments { border-collapse: collapse; }
table#unitassignments td { padding: .3em; border: 2px solid black; }
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial