json2html icon indicating copy to clipboard operation
json2html copied to clipboard

"border" table attribute is deprecated and not supported in HTML5

Open DeepSpace2 opened this issue 6 years ago • 0 comments

Should we consider using style= instead?

The default could be

<style>table, th, td {border: 1px solid black;}</style>
<table><tr><th>name</th><td>Json2Html</td></tr><tr><th>description</th><td>converts json 2 html table format</td></tr></table>

The problem here is that the generated <style> might of course clash with the user's existing style. A longer but safer alternative would be to use inline styles for each <table>, <th> and <td> tag:

<table style="border: 1px solid black;">
    <tr>
        <th style="border: 1px solid black;">name</th>
        <td style="border: 1px solid black;">Json2Html</td>
    </tr>
    <tr>
        <th style="border: 1px solid black;">description</th>
        <td style="border: 1px solid black;">converts json 2 html table format</td>
    </tr>
</table>

DeepSpace2 avatar Sep 10 '19 22:09 DeepSpace2