Closed Bug 1865543 Opened 2 years ago Closed 2 years ago

Table caption improperly placed

Categories

(Core :: Layout: Tables, defect)

Firefox 120
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: asa.rand, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0

Steps to reproduce:

I have put the page in question on my website: https://wayneca.neocities.org/Basic09/VariableList.html

The caption is being placed inside the table as the first cell of the first row.
It happens when using THEAD and TBODY inside the table.
The table is also a scrollable table.
If you look at the webpage, scroll down to the third table and you will see it.
If you look at the source you can see what I tried to get it to work.

Actual results:

Caption inside table instead of outside table, text wrapped as being inside the first cell of the first row (even though CAPTION is before the THEAD tag).
I used CSS to make the caption not wrap.

Expected results:

Caption should be outside the table, top,left and not wrapped, not inside the table and wrapped.

The Bugbug bot thinks this bug should belong to the 'Core::Layout: Tables' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Layout: Tables
Product: Firefox → Core

This is because display: block; rule applied on the <table>, which overrides the default display: table; rule.
Removing the display: block; rule should fix the <caption> behavior.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID

Thank you. This fixed the issue. I run into this sort of issue because it seems I have to constantly find different ways to make a scrollable table work. This means that I never know what CSS I will have to use to make it work. In this instance, display: block; was not necessary.

You need to log in before you can comment on or make changes to this bug.