Title: WP_HTML_Open_Elements::has_element_in_table_scope
Published: November 8, 2023
Last modified: February 24, 2026

---

# WP_HTML_Open_Elements::has_element_in_table_scope( string $tag_name ): bool

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/wp_html_open_elements/has_element_in_table_scope/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/classes/wp_html_open_elements/has_element_in_table_scope/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/classes/wp_html_open_elements/has_element_in_table_scope/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_html_open_elements/has_element_in_table_scope/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_html_open_elements/has_element_in_table_scope/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_html_open_elements/has_element_in_table_scope/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_html_open_elements/has_element_in_table_scope/?output_format=md#wp--skip-link--target)

Returns whether a particular element is in table scope.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/wp_html_open_elements/has_element_in_table_scope/?output_format=md#description)󠁿

> The stack of open elements is said to have a particular element in table scope
> when it has that element in the specific scope consisting of the following element
> types:
>  * html in the HTML namespace
>  * table in the HTML namespace
>  * template in the HTML namespace

### 󠀁[See also](https://developer.wordpress.org/reference/classes/wp_html_open_elements/has_element_in_table_scope/?output_format=md#see-also)󠁿

 * [https://html.spec.whatwg.org/#has-an-element-in-table-scope](https://html.spec.whatwg.org/#has-an-element-in-table-scope/)

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_html_open_elements/has_element_in_table_scope/?output_format=md#parameters)󠁿

 `$tag_name`stringrequired

Name of tag to check.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_html_open_elements/has_element_in_table_scope/?output_format=md#return)󠁿

 bool Whether given element is in scope.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_html_open_elements/has_element_in_table_scope/?output_format=md#source)󠁿

    ```php
     */
    public function has_element_in_table_scope( string $tag_name ): bool {
    	return $this->has_element_in_specific_scope(
    		$tag_name,
    		array(
    			'HTML',
    			'TABLE',
    			'TEMPLATE',
    		)
    	);
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/html-api/class-wp-html-open-elements.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/html-api/class-wp-html-open-elements.php#L447)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/html-api/class-wp-html-open-elements.php#L447-L456)

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_html_open_elements/has_element_in_table_scope/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.7.0](https://developer.wordpress.org/reference/since/6.7.0/) | Full implementation. | 
| [6.4.0](https://developer.wordpress.org/reference/since/6.4.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_html_open_elements%2Fhas_element_in_table_scope%2F)
before being able to contribute a note or feedback.