Is there a difference between
<table width="100%">
and
<table style="width: 100%">
I know that the img need
<img width="20px">
to precalculate the space it will use. But how is it with tables?
Is there a difference between
<table width="100%">
and
<table style="width: 100%">
I know that the img need
<img width="20px">
to precalculate the space it will use. But how is it with tables?
The first option is the old HTML strategy of setting properties of a table. It is deprecated because of concerns about adding "visualization" properties to your HTML code, which should focus on content markup.
The second option is the (new) CSS solution but, please, do not declare it "inline" but in a separate CSS file targeting the table element with a class or ID name, otherwise advantages are effectively null; CSS philosophy is based on separation between data and styles, so if you declare it "inline"... there is implicitly no separation.
1st example is HTML width tag, which nowadays is basically used on newsletters.
2nd example is CSS inline, not a good approach, unless you want to override some class style and you don't want to add more classes.
3rd example is like 1st example, and not necessary needs the unit measure , take a look: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Img