diff --git a/src/html/m_tables.cpp b/src/html/m_tables.cpp
index e6505e6898..b7ff14f6cb 100644
--- a/src/html/m_tables.cpp
+++ b/src/html/m_tables.cpp
@@ -118,7 +118,8 @@ wxHtmlTableCell::wxHtmlTableCell(wxHtmlContainerCell *parent, const wxHtmlTag& t
: wxHtmlContainerCell(parent)
{
m_PixelScale = pixel_scale;
- m_HasBorders = (tag.GetParam(wxT("BORDER")) != wxT("0"));
+ m_HasBorders =
+ (tag.HasParam(wxT("BORDER")) && tag.GetParam(wxT("BORDER")) != wxT("0"));
m_ColsInfo = NULL;
m_NumCols = m_NumRows = 0;
m_CellInfo = NULL;