4.5

4.5 | 2 ratings Rate this file 54 downloads (last 30 days) File Size: 4.17 KB File ID: #18329

Display data as an HTML table

by Gus Brown

 

15 Jan 2008 (Updated 15 Jan 2008)

Code covered by BSD License  

Display a matrix or cell array as a HTML formatted table

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

Download Now | Watch this File

File Information
Description

This is intended to be a simple way to display 2D or 3D table data with support for row and column labels.

It can also save the HTML code to a file, which can then be used elsewhere.

The function supports nested tables.

MATLAB release MATLAB 7.4 (R2007a)
Zip File Content  
Other Files GTHTMLtable.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (6)
15 Jan 2008 Matt Whitaker

Gus, This looks interesting but your m-file seems to have gotten garbled in the upload. Please re-load.
Thanks
Matt W.

15 Jan 2008 Gus Brown

I have re-uploaded the file.

15 Jan 2008 Gus Brown

I have Zipped the file to avoid any download problems. I think the presence of HTML code in the file prevents it from being downloaded correctly.

16 Jan 2008 John D'Errico

It now downloads properly. A very nice idea, well written, with good code.

My preference, with this many optional arguments, would have been to use a property/value pair interface. Its only a preference though.

The help is quite readable, at least when displayed using help. The examples are themselves in HTML. Ok, I'll admit I'm an HTML dinosaur, so when I looked at the examples in the editor as a flat text file, they were hard to read. Of course, if you are using this code, you probably know more about HTML than me anyway. IMHO, I also found the help to be slightly non-standard, at least according to my own standards. It was quite readable anyway.

I had one question that remained unanswered from the help. The latter arguments are intended to be character strings, as flags. Does capitalization matter? Can they be in any order? Can they be shortened, as long as that shortening is unambiguous? For example, instead of 'save','show', can you use 'Sh','sav'?

Because of the question above, part of me wanted to rate this a 4.5. It is really nice though, so I rounded up to 5.

16 Jan 2008 Gus Brown

Thanks for the detailed comments, it is really great to get that sort of feedback.

As for your preference for property value pairs, I would likely agree with you. However this was written as an experiment in 'freeform' input. Basically I wanted to be able to leave out certain inputs and have the function still be able to make sense of what is there.
For example, the first argument is normally the table title, but this can be left out, in which case the data becomes the first argument. The same applies to the format specifiers.

To answer your question...
The string 'flags' can be mixed case but they cannot be shortened. They can appear anywhere after the data. Which means that you cannot have a single column named 'save' because it will be seen as a flag, but I can live with that.

18 Jan 2008 kwadwo Dompreh

this is so beautiful, i really like it and hope could be upgraded to display much more things like diagrams.

Please login to add a comment or rating.
Updates
15 Jan 2008

Reupload due to garbled upload problem.
Also updated examples.

15 Jan 2008

I have Zipped the file to avoid any download problems. I think the presence of HTML code in the file prevents it from being downloaded correctly.

Tag Activity for this File
Tag Applied By Date/Time
structures Gus Brown 22 Oct 2008 09:42:45
cell arrays Gus Brown 22 Oct 2008 09:42:45
cell matrix html Gus Brown 22 Oct 2008 09:42:45
potw Cristina McIntire 07 Nov 2008 13:01:39
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com