diff --git a/dlls/mshtml/htmltable.c b/dlls/mshtml/htmltable.c
index 85daf5bca33..f3c7ba8355c 100644
--- a/dlls/mshtml/htmltable.c
+++ b/dlls/mshtml/htmltable.c
@@ -379,8 +379,21 @@ static HRESULT WINAPI HTMLTable_get_tFoot(IHTMLTable *iface, IHTMLTableSection *
static HRESULT WINAPI HTMLTable_get_tBodies(IHTMLTable *iface, IHTMLElementCollection **p)
{
HTMLTable *This = impl_from_IHTMLTable(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+ nsIDOMHTMLCollection *nscol = NULL;
+ nsresult nsres;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ nsres = nsIDOMHTMLTableElement_GetTBodies(This->nstable, &nscol);
+ if(NS_FAILED(nsres)) {
+ ERR("GetTBodies failed: %08x\n", nsres);
+ return E_FAIL;
+ }
+
+ *p = create_collection_from_htmlcol(This->element.node.doc, nscol);
+
+ nsIDOMHTMLCollection_Release(nscol);
+ return S_OK;
}
static HRESULT WINAPI HTMLTable_get_caption(IHTMLTable *iface, IHTMLTableCaption **p)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 5cb0a946bf9..44306ee0180 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -5466,6 +5466,7 @@ static void test_table_elem(IHTMLElement *elem)
static const elem_type_t row_types[] = {ET_TR,ET_TR};
static const elem_type_t all_types[] = {ET_TBODY,ET_TR,ET_TR,ET_TD,ET_TD};
+ static const elem_type_t tbodies_types[] = {ET_TBODY};
hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLTable, (void**)&table);
ok(hres == S_OK, "Could not get IHTMLTable iface: %08x\n", hres);
@@ -5475,7 +5476,7 @@ static void test_table_elem(IHTMLElement *elem)
col = NULL;
hres = IHTMLTable_get_rows(table, &col);
ok(hres == S_OK, "get_rows failed: %08x\n", hres);
- ok(col != NULL, "get_ros returned NULL\n");
+ ok(col != NULL, "get_rows returned NULL\n");
test_elem_collection((IUnknown*)col, row_types, sizeof(row_types)/sizeof(*row_types));
IHTMLElementCollection_Release(col);
@@ -5492,6 +5493,14 @@ static void test_table_elem(IHTMLElement *elem)
test_elem_all((IUnknown*)node, NULL, 0);
IHTMLDOMNode_Release(node);
+ col = NULL;
+ hres = IHTMLTable_get_tBodies(table, &col);
+ ok(hres == S_OK, "get_tBodies failed: %08x\n", hres);
+ ok(col != NULL, "get_tBodies returned NULL\n");
+
+ test_elem_collection((IUnknown*)col, tbodies_types, sizeof(tbodies_types)/sizeof(*tbodies_types));
+ IHTMLElementCollection_Release(col);
+
IHTMLTable_Release(table);
}