-
Notifications
You must be signed in to change notification settings - Fork 22.4k
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
Add HTMLTable*Element.{valign|align} #33035
base: main
Are you sure you want to change the base?
Conversation
@@ -202,11 +202,12 @@ p { | |||
|
|||
```html | |||
<table> | |||
<tr> | |||
<tr style="vertical-align: bottom"> |
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.
This example is a little complex now and I think it would help to have a short explanation at the start, right after the "Vertical alignment in a table cell" heading, something like:
In this example we have a table with a single row containing six cells. The row sets
vertical-align
tobottom
.
- The first four cells each set their own
vertical-align
values, and these override the row's value.- The fifth cell does not set any
vertical-align
value, so inherits the row's value.The sixth cell is only used to ensure that the cells are tall enough to see the effect.
Also, I wonder if we could take some steps to make it less likely we'll see a scrollbar in this example. Even just reducing the size of the dummy text in cell 6 would help.
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.
- Added a text to describe
- Change the text of the 6th cell to a Lorem Ipsum and no scrollbar appear at any size
- Used a class and CSS instead of inline styling
@@ -161,6 +161,14 @@ This example demonstrates how the use of `text-align` on {{htmlelement("table")} | |||
|
|||
```html | |||
<table> | |||
<caption style="text-align: right"> |
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.
The description is a bit weird now:
This example demonstrates how the use of text-align on
<table>
elements, including<tr>
rows and<td>
cells.
...since it now includes other table elements. Probably better to say:
This example demonstrates how the use of text-align on
<table>
elements.
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.
And again, it would be good to explain a bit about what's being set here and what the effect is.
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.
In general, to demonstrate best practices, avoid inline styles.
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.
I have improved the description and avoided inline styles now.
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.
The inline style still seems to be here and at line 175?
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.
Fixed
@@ -161,6 +161,14 @@ This example demonstrates how the use of `text-align` on {{htmlelement("table")} | |||
|
|||
```html | |||
<table> | |||
<caption style="text-align: right"> |
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.
The inline style still seems to be here and at line 175?
Co-authored-by: wbamberg <[email protected]>
Co-authored-by: wbamberg <[email protected]>
I've added:
Ready for another review |
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.
since we were talking about it during the call this morning, i took a look and have a few suggestions.
Description
This PR adds docs for the following properties:
HTMLTableRowlElement.align
HTMLTableRowElement.valign
HTMLTableCaptionElement.align
HTMLTableSectionElement.align
HTMLTableSectionElement.valign
Motivation
These properties are supported by all engines.
Though deprecated, they are common tasks for beginners: we need documentation that points to the right way of doing this (TM), using
text-align
andvertical-align
Additional details
There is no example as this is deprecated: the example sections point to examples using the modern (CSS) way of doing it so that they are one click away.
I used the same structure as in #32993.
HTMLTableColElement
also has these two properties but their translation in CSS is more complicated so they will be in a separate PR.Related issues and pull requests
It is part of mdn/mdn#520