Skip to content

Comment on Show HN: A souped-up HTML-based table

Comments

Why the special grid/row/cell tags and special data inpits? Why not just use a vanilla HTML table, then you would at least have graceful degradation?

For the XML format? Good point that would be better.

Yeah. What I'm thinking is, instead of loading external XML, you could just have something like:

  <table id=fancy-table>
      <thead>
          <tr><th>Column 1</th><th>Column 2</th><th>Column 3</th></tr>
      </thead>
      <tbody>
          <tr><td>Item 1</td><td>Item 2</td><td>Item 3</td></tr>
      </tbody>
  </table>

  <script>
    new Grid("fancyTable", {
      srcType : "html",
      srcData : '#fancy-table',
      allowGridResize : true, 
      allowColumnResize : true, 
      allowClientSideSorting : true, 
      allowSelections : true, 
      allowMultipleSelections : true, 
      showSelectionColumn : true, 
      fixedCols : 1
    });
  </script>
(This way, if JS is unsupported/the JS code breaks/JS is disabled/slow connection/etc., you'll still see the data)
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.