-
Notifications
You must be signed in to change notification settings - Fork 60
Use <caption> for table captions instead of <figcaption> #706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use <caption> for table captions instead of <figcaption> #706
Conversation
Tables with captions will no longer be embedded in a <figure> with a <figcaption>. Instead, the <table> will simply have a <caption> as its first element when needed. For table captions, the position of the caption must be done in CSS since the <caption> is always required to be the first element of the <table> and cannot be moved to the end like they can with figure captions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Marcus for reviewing #692 and submitting this new PR!
Since caption element has to be the first element of the table, this makes much more sense!
I reflected on the centered
prop and I proposed a refactor in the CSS. Let me know if it makes sense or I'm missing some use case. (Hopefully not!)
Co-authored-by: Marina Aísa <[email protected]>
* replace `centered` prop with `position` * simplify margin styling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested in various scenarios, looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
@swift-ci test |
Use <caption> for tables instead of <figcaption>. Tables with captions will no longer be embedded in a <figure> with a <figcaption>. Instead, the <table> will simply have a <caption> as its first element when needed. Co-authored-by: Marina Aísa <[email protected]>
Bug/issue #, if applicable: 30234820
Summary
Use
<caption>
for tables instead of<figcaption>
.Tables with captions will no longer be embedded in a
<figure>
with a<figcaption>
. Instead, the<table>
will simply have a<caption>
as its first element when needed.For table captions, the position of the caption must be done in CSS since the
<caption>
is always required to be the first element of the<table>
and cannot be moved to the end like they can with figure captions.Testing
Steps:
<table><caption>
instead of<figure><figcaption><table>
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
npm test
, and it succeeded