",
CellPadding); // CellPadding must be 0, 1, 2, 5 or 10
else
Tbl_TABLE_BeginWideMargin ();
}
void Tbl_TABLE_BeginWideMargin (void)
{
fprintf (Gbl.F.Out,"");
}
void Tbl_TABLE_End (void)
{
fprintf (Gbl.F.Out,"
");
}
/*****************************************************************************/
/**************************** Start/end table row ****************************/
/*****************************************************************************/
void Tbl_TR_Begin (const char *fmt,...)
{
va_list ap;
int NumBytesPrinted;
char *Attr;
if (fmt)
{
if (fmt[0])
{
va_start (ap,fmt);
NumBytesPrinted = vasprintf (&Attr,fmt,ap);
va_end (ap);
if (NumBytesPrinted < 0) // If memory allocation wasn't possible,
// or some other error occurs,
// vasprintf will return -1
Lay_NotEnoughMemoryExit ();
/***** Print HTML *****/
fprintf (Gbl.F.Out,"",Attr);
free ((void *) Attr);
}
else
Tbl_TR_BeginWithoutAttr ();
}
else
Tbl_TR_BeginWithoutAttr ();
}
static void Tbl_TR_BeginWithoutAttr (void)
{
fprintf (Gbl.F.Out,"
");
}
void Tbl_TR_End (void)
{
fprintf (Gbl.F.Out,"
");
}
/*****************************************************************************/
/***************************** Table heading cells ***************************/
/*****************************************************************************/
void Tbl_TH_Begin (const char *fmt,...)
{
va_list ap;
int NumBytesPrinted;
char *Attr;
if (fmt)
{
if (fmt[0])
{
va_start (ap,fmt);
NumBytesPrinted = vasprintf (&Attr,fmt,ap);
va_end (ap);
if (NumBytesPrinted < 0) // If memory allocation wasn't possible,
// or some other error occurs,
// vasprintf will return -1
Lay_NotEnoughMemoryExit ();
/***** Print HTML *****/
fprintf (Gbl.F.Out,"",Attr);
free ((void *) Attr);
}
else
Tbl_TH_BeginWithoutAttr ();
}
else
Tbl_TH_BeginWithoutAttr ();
}
static void Tbl_TH_BeginWithoutAttr (void)
{
fprintf (Gbl.F.Out," | ");
}
void Tbl_TH_End (void)
{
fprintf (Gbl.F.Out," | ");
}
void Tbl_TH_Empty (unsigned NumColumns)
{
unsigned NumCol;
for (NumCol = 0;
NumCol < NumColumns;
NumCol++)
{
Tbl_TH_Begin (NULL);
Tbl_TH_End ();
}
}
/*****************************************************************************/
/********************************* Table cells *******************************/
/*****************************************************************************/
void Tbl_TD_Begin (const char *fmt,...)
{
va_list ap;
int NumBytesPrinted;
char *Attr;
if (fmt)
{
if (fmt[0])
{
va_start (ap,fmt);
NumBytesPrinted = vasprintf (&Attr,fmt,ap);
va_end (ap);
if (NumBytesPrinted < 0) // If memory allocation wasn't possible,
// or some other error occurs,
// vasprintf will return -1
Lay_NotEnoughMemoryExit ();
/***** Print HTML *****/
fprintf (Gbl.F.Out,"",Attr);
free ((void *) Attr);
}
else
Tbl_TD_BeginWithoutAttr ();
}
else
Tbl_TD_BeginWithoutAttr ();
}
static void Tbl_TD_BeginWithoutAttr (void)
{
fprintf (Gbl.F.Out," | ");
}
void Tbl_TD_End (void)
{
fprintf (Gbl.F.Out," | ");
}
void Tbl_TD_Empty (unsigned NumColumns)
{
unsigned NumCol;
for (NumCol = 0;
NumCol < NumColumns;
NumCol++)
{
Tbl_TD_Begin (NULL);
Tbl_TD_End ();
}
}
void Tbl_TD_ColouredEmpty (unsigned NumColumns)
{
unsigned NumCol;
for (NumCol = 0;
NumCol < NumColumns;
NumCol++)
{
Tbl_TD_Begin ("class=\"COLOR%u\"",Gbl.RowEvenOdd);
Tbl_TD_End ();
}
}