",
CellPadding); // CellPadding must be 0, 1, 2, 5 or 10
else
Tbl_StartTableWideMargin ();
}
void Tbl_StartTableWideMargin (void)
{
fprintf (Gbl.F.Out,"");
}
void Tbl_EndTable (void)
{
fprintf (Gbl.F.Out,"
");
}
/*****************************************************************************/
/**************************** Start/end table row ****************************/
/*****************************************************************************/
void Tbl_StartRowAttr (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_StartRow ();
}
else
Tbl_StartRow ();
}
void Tbl_StartRow (void)
{
fprintf (Gbl.F.Out,"
");
}
void Tbl_EndRow (void)
{
fprintf (Gbl.F.Out,"
");
}
/*****************************************************************************/
/********************************* Table cells *******************************/
/*****************************************************************************/
void Tbl_StartCellAttr (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_StartCell ();
}
else
Tbl_StartCell ();
}
void Tbl_StartCell (void)
{
fprintf (Gbl.F.Out," | ");
}
void Tbl_EndCell (void)
{
fprintf (Gbl.F.Out," | ");
}
void Tbl_PutEmptyCells (unsigned NumColumns)
{
unsigned NumCol;
for (NumCol = 0;
NumCol < NumColumns;
NumCol++)
fprintf (Gbl.F.Out," | ");
}
void Tbl_PutEmptyColouredCells (unsigned NumColumns)
{
unsigned NumCol;
for (NumCol = 0;
NumCol < NumColumns;
NumCol++)
fprintf (Gbl.F.Out," | ",
Gbl.RowEvenOdd);
}