Added: html TH element

--HG--
branch : develop
hg/feature/material-editor
Nimetu 9 years ago
parent 2eb56b6460
commit fe476d4872

@ -1783,11 +1783,21 @@ namespace NLGUI
_TR.push_back(false);
}
break;
case HTML_TH:
// TH is similar to TD, just different font style
case HTML_TD:
{
// Get cells parameters
getCellsParameters (MY_HTML_TD, true);
if (element_number == HTML_TH)
{
_FontWeight.push_back(FONT_WEIGHT_BOLD);
// center if not specified otherwise. TD/TH present/value arrays have same indices
if (!(present[MY_HTML_TD_ALIGN] && value[MY_HTML_TD_ALIGN]))
_CellParams.back().Align = CGroupCell::Center;
}
CGroupTable *table = getTable();
if (table)
{
@ -2124,6 +2134,9 @@ namespace NLGUI
endParagraph();
// Add a cell
break;
case HTML_TH:
popIfNotEmpty (_FontWeight);
// no break;
case HTML_TD:
popIfNotEmpty (_CellParams);
if (!_Cells.empty())

@ -481,6 +481,8 @@ namespace NLGUI
HTML_DTD->tags[HTML_TR].number_of_attributes = sizeof(tr_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_TD].attributes = td_attr;
HTML_DTD->tags[HTML_TD].number_of_attributes = sizeof(td_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_TH].attributes = td_attr;
HTML_DTD->tags[HTML_TH].number_of_attributes = sizeof(td_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_IMG].attributes = img_attr;
HTML_DTD->tags[HTML_IMG].number_of_attributes = sizeof(img_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_INPUT].attributes = input_attr;

Loading…
Cancel
Save