[%########################################
  table_bordered_begin( table_width, bgcolor, border_width, border_color)
     Begin a bordered table. Border color is set in theme, just pass
     in the table width (no default) and border width (in pixels, default: 2)
  ########################################-%]

[%- DEFAULT theme        = OI.theme_properties; 
    DEFAULT border_width = 2; 
    DEFAULT border_color = theme.border_color;
    DEFAULT bgcolor      = theme.bgcolor;
    SET width = ( table_width ) ? "width='$table_width'" : ''  -%]
<table border="0" cellspacing="0" [% width -%]
       bgcolor="[% border_color %]" 
       cellpadding="[% border_width %]">
<tr><td>

  <table border="0" width="100%"          
         cellpadding="5" cellspacing="0"
         bgcolor="[% bgcolor %]">