Quickly format tables for SugarCRM

If you are hand-coding tables for SugarCRM then you can skip the tedious addition of attributes to table elements by using my sugarTables.js script to quickly format a table in a SugarCRM style. The script requires PrototypeJS.

For example, creating a table like this:

renders a table looking like this:

The makeSugarList() method works in the same way as makeSugarDetail() except that it formats a table in Sugar’s standard list format.

Both functions return the element so that you can add further formatting inline if desired, as in the example below which makes the table 100% wide after formatting in SugarCRM styling:

Download the script here

There are a lot of tables hard coded in SugarCRM. I would dearly like to see Sugar use a standard function like this to format tables rather than manually adding attributes into the original code. There are far too many errors in Sugar’s HTML code, all down to human error, and these could be easily avoided.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">