      SUBROUTINE PLH.BLD.TABLE.EXT(CMD,TBL.OPTIONS,C.WID,R.OPTS,C.DATA,C.OPTS,RES)
*PIC-LAN
*
*ALL
*PC
*Y
*
*
*
      RES = ''
*
      V.FLG = ( INDEX(OCONV(CMD,'MCU'),'V',1) <> 0 )
      I.FLG = ( INDEX(OCONV(CMD,'MCU'),'I',1) <> 0 )
*
      IF I.FLG THEN
         I4 = '    '
         I8 = '        '
      END ELSE
         I4 = ''
         I8 = ''
      END
*
      RES = ''
      RES<-1> = '<table ' : TBL.OPTIONS : '>'
*
      N.ROWS = DCOUNT(C.DATA,AM)
      T      = DCOUNT(C.OPTS,AM)
      IF T > N.ROWS THEN N.ROWS = T
      FOR ROW = 1 TO N.ROWS
         RES<-1> = I4 : '<tr ' : R.OPTS<ROW> : '>'
         N.COLS = DCOUNT(C.DATA<ROW>,VM)
         T      = DCOUNT(C.OPTS<ROW>,VM)
         IF T > N.COLS THEN N.COLS = T
         FOR COL = 1 TO N.COLS
            T = ''
            IF ROW = 1 THEN
               IF C.WID<COL> <> '' THEN
                  T = ' width="' : C.WID<COL> : '"'
               END
            END
            TT = C.OPTS<ROW,COL>
            IF TT <> '' THEN
               T = T : ' ' : TT
            END
            RES<-1> = I8 : '<td' : T : '>' : C.DATA<ROW,COL> : '</td>'
         NEXT COL
         RES<-1> = I4 : '</tr>'
      NEXT ROW
*
      RES<-1> = '</table>'
*
      RETURN
   END
