Re: HTML 5 conformance: table border obsolete?

Guus Schreiber <guus.schreiber@vu.nl>, 2014-02-05 23:00 +0100:

> Some time early this year the validator has started to give an error message
> when encountering:
> 
>   <table border="1">.

You should specify the table border display properties using CSS instead.

The table@border attribute is legacy presentational markup:

  "...presentational markup has been removed from HTML in this version...
  The only remaining presentational markup features in HTML are the style
  attribute and the style element."
  http://www.w3.org/TR/html/introduction.html#presentational-markup

If you want roughly the same display as what browsers display for the legacy
<table border="1"> presentational markup, you can use the following CSS:

table {
  border-style: outset;
  border-width: 1px;
  border-spacing: 2px;
}
table td {
  border-style: inset;
  border-width: 1px;
}

And by moving to using CSS to specify the display properties, you're no
longer locking yourself and your readers into being stuck with the (really
dated-looking now..) browser default table@border display -- you also gain
the flexibility of being able to make your table borders look however you
actually want, just as easily as what you'd need to emulate the legacy
table@border look.

So using CSS for your table borders gets you a large flexibility gain while
only requiring very little additional work from you. But more importantly,
it's a win for users because you can give them table borders that actually
look good -- that look like table borders they see in other current Web
documents. (I don't think there are any actual users out there saying, Boy
I wish more tables on the Web today looked like the ones we got in the old
days from authors just using table@border=1.)

  --Mike

-- 
Michael[tm] Smith http://people.w3.org/mike

Received on Wednesday, 5 February 2014 23:37:47 UTC