diff --git a/src/AngleSharp.Css.Tests/Extensions/InnerText.cs b/src/AngleSharp.Css.Tests/Extensions/InnerText.cs
index f12fb38..5c1044d 100644
--- a/src/AngleSharp.Css.Tests/Extensions/InnerText.cs
+++ b/src/AngleSharp.Css.Tests/Extensions/InnerText.cs
@@ -47,6 +47,7 @@ public void SetInnerText(String fixture, String expectedInnerText, String expect
[TestCase("test1
test2
test3", "test1\ntest2\ntest3")]
// table
[TestCase("
", "1\t2\n3\t4")]
+ [TestCase("", "1\t2\n3\t4")]
[TestCase("", "1\t2\n\n3\t4\n\t5")]
// select
[TestCase("", "test1\ntest2")]
diff --git a/src/AngleSharp.Css/Extensions/ElementExtensions.cs b/src/AngleSharp.Css/Extensions/ElementExtensions.cs
index cc25785..a0a358e 100644
--- a/src/AngleSharp.Css/Extensions/ElementExtensions.cs
+++ b/src/AngleSharp.Css/Extensions/ElementExtensions.cs
@@ -204,7 +204,7 @@ private static void ItcInCssBox(ICssStyleDeclaration elementStyle, ICssStyleDecl
}
else if (elementStyle is not null && ((node is IHtmlTableCellElement && String.IsNullOrEmpty(elementStyle.GetDisplay())) || elementStyle.GetDisplay() == CssKeywords.TableCell))
{
- if (node.NextSibling is IElement nextSibling)
+ if (((IElement)node).NextElementSibling is IElement nextSibling)
{
var nextSiblingCss = nextSibling.ComputeCurrentStyle();
@@ -216,7 +216,7 @@ private static void ItcInCssBox(ICssStyleDeclaration elementStyle, ICssStyleDecl
}
else if (elementStyle is not null && ((node is IHtmlTableRowElement && String.IsNullOrEmpty(elementStyle.GetDisplay())) || elementStyle.GetDisplay() == CssKeywords.TableRow))
{
- if (node.NextSibling is IElement nextSibling)
+ if (((IElement)node).NextElementSibling is IElement nextSibling)
{
var nextSiblingCss = nextSibling.ComputeCurrentStyle();