Return the value (string) of the requested column In the case of a table, the only allowed sub-nodes are <tr> nodes. The columns for the table are all under the table's first <tr> sub-node as <th> nodes.
| Return Type | Function name | Arguments |
|---|---|---|
| hzString | hzHtmTbl::GetColl | (uint32_t,) |
Declared in file: hzDocument.h
Defined in file : hzDocHtml.cpp
Function Logic:
Function body:
hzString hzHtmTbl::GetColl (uint32_t nCol)
{
// Return the value (string) of the requested column
//
// In the case of a table, the only allowed sub-nodes are <tr> nodes. The columns for the table are all under the table's first <tr> sub-node as <th> nodes.
//
// Arguments: 1) nCol The column number
//
// Returns: Instance of hzString by value - of the table row as a concatenated series of <td>content</td>
hzHtmElem* pE ; // Table row tags
hzHtmElem* pC ; // Columns
hzString S ; // Target string
uint32_t nIndex ; // Column iterator
if (!m_Children)
return S ;
pE = GetFirstChild() ;
if (!pE->GetFirstChild())
return S ;
nIndex = 0;
for (pC = pE->GetFirstChild() ; pC ; pC = pC->Sibling())
{
if (pC->Type() != HTAG_THEAD)
continue ;
if (nIndex == nCol)
{
S = pC->m_tmpContent ;
break ;
}
nIndex++ ;
}
return S ;
}