Skip to content
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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Conversation

teoli2003
Copy link
Member

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 and vertical-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

@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs Content:WebAPI Web API docs size/m 51-500 LoC changed labels Apr 11, 2024
@teoli2003 teoli2003 marked this pull request as ready for review April 11, 2024 09:54
@teoli2003 teoli2003 requested review from a team as code owners April 11, 2024 09:54
@teoli2003 teoli2003 requested review from wbamberg, dipikabh and estelle and removed request for a team, wbamberg and dipikabh April 11, 2024 09:54
@@ -202,11 +202,12 @@ p {

```html
<table>
<tr>
<tr style="vertical-align: bottom">
Copy link
Collaborator

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.

Copy link
Member Author

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">
Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Collaborator

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@teoli2003 teoli2003 requested a review from wbamberg April 12, 2024 13:42
files/en-us/web/css/text-align/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/text-align/index.md Outdated Show resolved Hide resolved
@@ -161,6 +161,14 @@ This example demonstrates how the use of `text-align` on {{htmlelement("table")}

```html
<table>
<caption style="text-align: right">
Copy link
Collaborator

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?

@teoli2003
Copy link
Member Author

I've added:

  • and accepted the changes
  • removed the inline styles that I forgot to remove

Ready for another review

@teoli2003 teoli2003 requested a review from wbamberg April 15, 2024 06:05
files/en-us/web/css/text-align/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/text-align/index.md Outdated Show resolved Hide resolved
Copy link
Member

@estelle estelle left a 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.

@estelle estelle requested a review from wbamberg June 18, 2024 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:CSS Cascading Style Sheets docs Content:WebAPI Web API docs size/m 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants