Skip to content

[Bug]: Wrong HTML table form. #70

@ve3

Description

@ve3

Description of the bug

Your current example for Table with class form-table is...

<table class="form-table">
    <tbody>
        <tr>
            <th class="row-title">Table header cell #1</th>
            <th>Table header cell #2</th>
        </tr>
        <tr valign="top">
            <td scope="row">
                <label for="tablecell">Table data cell #1, with label</label>
            </td>
            <td>Table Cell #2</td>
        </tr>
        <tr valign="top" class="alternate">
            <td scope="row">
                <label for="tablecell">Table Cell #3, with label and class <code>alternate</code>
                </label>
            </td>
            <td>Table Cell #4</td>
        </tr>
        <tr valign="top">
            <td scope="row">
                <label for="tablecell">Table Cell #5, with label</label>
            </td>
            <td>Table Cell #6</td>
        </tr>
    </tbody>
</table>

And with HTML above, the result is wrong. The column of field name is too wide.

Refer from WordPress Settings page (General Settings), the differents are:

  • You have no role="presentation" on <table> tag. (This is not required but I just refer from settings page.)
  • Form table does not need table header (<tr><th>..</th><th>..</th></tr>).
  • The form row should be use <th> on the field name. Example: <tr><th scope="row">Name</th><td>..</td></tr>. You are currently using <td scope="row">.

Reproduction instructions

  1. Activate plugin.
  2. Go to Admin Style menu from the left.
  3. Click on Tables.

Expected behavior

Expect table form or form table to have narrower field name column like in any Settings pages.

Environment info

  • Plugin v 1.6.1
  • WordPress 6.9-RC2-61274

Relevant log output

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions