Hi Everyone, I need to extract some text from a HTML table
I tried using
tblGridHeader.Rows[0].InnerText.ToString()
But I'm getting the error of
"HTMLTableRow" does not support InnerText property.
I also tried InnerHTML, and still no go.
I did try using the cells property, but I'm getting an error of
Specified argument was out of the range of valid values.
Note: I just tried the cells property on a static table and it worked. So I guess it's something to do with my table being dynamically populated?
Code from visual studio editor:
<div id="divGridHeader" runat="Server" style="width:771px; text-align:left; overflow:hidden; float:left">
<table cellpadding="0" cellspacing="0" border="0" id="tblGridHeader" runat="Server">
<tr id="trMonth" runat="Server" class="fixedHeader">
</tr>
<tr id="trDaysOfWeek" runat="Server" class="fixedHeader">
</tr>
<tr id="trDaysInMonth" runat="Server" class="fixedHeader">
</tr>
<tr id="trFteLimit" runat="Server" class="fixedHeader" style="color:Black">
</tr>
</table>
</div>
Code from browser:
<div id="ctl00_cphWorkforceScheduler_divGridHeader" style="overflow: hidden; width: 771px; text-align: left; float: left;">
<table id="ctl00_cphWorkforceScheduler_tblGridHeader" cellspacing="0" cellpadding="0" border="0" width="1085">
<tbody>
<tr id="ctl00_cphWorkforceScheduler_trMonth" class="fixedHeader">
</tr>
<tr id="ctl00_cphWorkforceScheduler_trDaysOfWeek" class="fixedHeader">
</tr>
<tr id="ctl00_cphWorkforceScheduler_trDaysInMonth" class="fixedHeader">
<th id="ctl00_cphWorkforceScheduler_thDay_10012010120000AM" class="tt" onmouseout="HideToolTip(ctl00_cphWorkforceScheduler_spnWorkforceToolTip_ctl00_cphWorkforceScheduler_thDay_10012010120000AM, ctl00_cphWorkforceScheduler_spnWorkforceToolTipMiddle_ctl00_cphWorkforceScheduler_thDay_10012010120000AM);" onmouseover="ShowToolTip(ctl00_cphWorkforceScheduler_spnWorkforceToolTip_ctl00_cphWorkforceScheduler_thDay_10012010120000AM, ctl00_cphWorkforceScheduler_spnWorkforceToolTipMiddle_ctl00_cphWorkforceScheduler_thDay_10012010120000AM, '135px');" style="background-repeat: repeat-x; text-align: center; font-size: 8pt; font-weight: normal; background-image: url(../Images/TitleGradientMiddle.JPG); height: 20px; width: 35px; text-decoration: none;">
</th>
<th id="ctl00_cphWorkforceScheduler_thDay_10022010120000AM" class="tt" onmouseout="HideToolTip(ctl00_cphWorkforceScheduler_spnWorkforceToolTip_ctl00_cphWorkforceScheduler_thDay_10022010120000AM, ctl00_cphWorkforceScheduler_spnWorkforceToolTipMiddle_ctl00_cphWorkforceScheduler_thDay_10022010120000AM);" onmouseover="ShowToolTip(ctl00_cphWorkforceScheduler_spnWorkforceToolTip_ctl00_cphWorkforceScheduler_thDay_10022010120000AM, ctl00_cphWorkforceScheduler_spnWorkforceToolTipMiddle_ctl00_cphWorkforceScheduler_thDay_10022010120000AM, '135px');" style="background-repeat: repeat-x; text-align: center; font-size: 8pt; font-weight: normal; background-image: url(../Images/TitleGradientMiddle.JPG); height: 20px; width: 35px; text-decoration: none;">
Etc, etc. I didn't paste everything since there's a lot of tags. Please assume that HTML is well formed.