/// <summary> /// Gets the complete column of the given cell. /// <remarks>Attention: Handling "colspan" is not implemented. /// A TR without any TD is skipped.</remarks> /// </summary> public static IEnumerable <IHtmlElement> GetColumn(IHtmlElement cell) { cell.Require(x => cell != null); HtmlTable table = cell.FindEmbeddingTable(); if (table == null) { throw new ArgumentException("Element does not point to into table"); } int colIdx = cell.GetChildPos(); foreach (object row in table.TableBody.Children) { IHtmlElement e = ((IHtmlElement)row).GetChildAt("TD", colIdx); if (e == null) { continue; } yield return(e); } }
/// <summary> /// Gets the complete column of the given cell. /// <remarks>Attention: Handling "colspan" is not implemented. /// A TR without any TD is skipped.</remarks> /// </summary> public static IEnumerable<IHtmlElement> GetColumn( IHtmlElement cell ) { cell.Require( x => cell != null ); HtmlTable table = cell.FindEmbeddingTable(); if ( table == null ) { throw new ArgumentException( "Element does not point to into table" ); } int colIdx = cell.GetChildPos(); foreach ( object row in table.TableBody.Children ) { IHtmlElement e = ((IHtmlElement)row).GetChildAt( "TD", colIdx ); if ( e == null ) { continue; } yield return e; } }