version 1.4, 2011/01/06 11:55:39 |
version 1.6, 2011/01/11 14:12:01 |
Line 56 print_tbl(struct html *h, const struct tbl_span *sp) |
|
Line 56 print_tbl(struct html *h, const struct tbl_span *sp) |
|
struct roffsu su; |
struct roffsu su; |
struct roffcol *col; |
struct roffcol *col; |
|
|
switch (sp->pos) { |
|
case (TBL_SPAN_HORIZ): |
|
/* FALLTHROUGH */ |
|
case (TBL_SPAN_DHORIZ): |
|
return; |
|
default: |
|
break; |
|
} |
|
|
|
/* Inhibit printing of spaces: we do padding ourselves. */ |
/* Inhibit printing of spaces: we do padding ourselves. */ |
|
|
h->flags |= HTML_NONOSPACE; |
h->flags |= HTML_NONOSPACE; |
Line 78 print_tbl(struct html *h, const struct tbl_span *sp) |
|
Line 69 print_tbl(struct html *h, const struct tbl_span *sp) |
|
tblcalc(&h->tbl, sp); |
tblcalc(&h->tbl, sp); |
} |
} |
|
|
PAIR_CLASS_INIT(&tag, "tbl"); |
switch (sp->pos) { |
|
case (TBL_SPAN_HORIZ): |
|
/* FALLTHROUGH */ |
|
case (TBL_SPAN_DHORIZ): |
|
break; |
|
default: |
|
PAIR_CLASS_INIT(&tag, "tbl"); |
|
print_otag(h, TAG_TABLE, 1, &tag); |
|
print_otag(h, TAG_TR, 0, NULL); |
|
|
print_otag(h, TAG_TABLE, 1, &tag); |
/* Iterate over template headers. */ |
print_otag(h, TAG_TR, 0, NULL); |
|
|
|
dp = sp->first; |
dp = sp->first; |
for (hp = sp->head; hp; hp = hp->next) { |
for (hp = sp->head; hp; hp = hp->next) { |
switch (hp->pos) { |
switch (hp->pos) { |
case (TBL_HEAD_VERT): |
case (TBL_HEAD_VERT): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case (TBL_HEAD_DVERT): |
case (TBL_HEAD_DVERT): |
continue; |
continue; |
case (TBL_HEAD_DATA): |
case (TBL_HEAD_DATA): |
break; |
break; |
} |
} |
|
|
/* |
/* |
* For the time being, use the simplest possible table |
* For the time being, use the simplest possible |
* styling: setting the widths of data columns. |
* table styling: setting the widths of data |
*/ |
* columns. |
|
*/ |
|
|
col = &h->tbl.cols[hp->ident]; |
col = &h->tbl.cols[hp->ident]; |
SCALE_HS_INIT(&su, col->width); |
SCALE_HS_INIT(&su, col->width); |
bufcat_su(h, "width", &su); |
bufcat_su(h, "width", &su); |
PAIR_STYLE_INIT(&tag, h); |
PAIR_STYLE_INIT(&tag, h); |
tt = print_otag(h, TAG_TD, 1, &tag); |
tt = print_otag(h, TAG_TD, 1, &tag); |
if (dp) { |
|
if (dp->string) |
if (dp) { |
print_text(h, dp->string); |
switch (dp->layout->pos) { |
dp = dp->next; |
case (TBL_CELL_DOWN): |
|
break; |
|
default: |
|
if (NULL == dp->string) |
|
break; |
|
print_text(h, dp->string); |
|
break; |
|
} |
|
dp = dp->next; |
|
} |
|
|
|
print_tagq(h, tt); |
} |
} |
print_tagq(h, tt); |
break; |
} |
} |
|
|
h->flags &= ~HTML_NONOSPACE; |
h->flags &= ~HTML_NONOSPACE; |
|
|
/* Close out column specifiers on the last span. */ |
/* Close out column specifiers on the last span. */ |