/// <summary> /// Returns the TR element embedding the given element. /// If the given element itself is a TR, this one is returned. /// </summary> public static IHtmlElement GetEmbeddingTR(IHtmlElement e) { e.Require(x => e != null); if (e.TagName == "TR") { return(e); } else { var parent = e.FindParent(p => p.TagName == "TR", p => e.IsTableOrTBody()); return(parent == null ? null : parent); } }
/// <summary> /// Returns the TR element embedding the given element. /// If the given element itself is a TR, this one is returned. /// </summary> public static IHtmlElement GetEmbeddingTR( IHtmlElement e ) { e.Require( x => e != null ); if ( e.TagName == "TR" ) { return e; } else { var parent = e.FindParent( p => p.TagName == "TR", p => e.IsTableOrTBody() ); return (parent == null ? null : parent); } }