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 HTMLTableColElement.{align|valign} #33101

Merged
merged 7 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Apply suggestions from code review
  • Loading branch information
estelle committed Jun 18, 2024
commit 448734cf0981bf84e257b6efdb60e0303f751da9
6 changes: 3 additions & 3 deletions files/en-us/web/api/htmltablecolelement/align/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ The **`align`** property of the {{domxref("HTMLTableColElement")}} interface is

> **Note:** This property is deprecated, and CSS should be used to align text horizontally in a column. Use the CSS {{cssxref("text-align")}} property, which takes precedence, to horizontally align text in a column instead.
>
> As {{htmlelement("td")}} are not children of {{htmlelement("col")}}, you can't set it directly on a {{HTMLElement("col")}} element, you need to select the cells of the column using a `td:nth-child(n)` or similar (`n` is the column number).
> As {{htmlelement("td")}} are not children of {{htmlelement("col")}}, you can't set it directly on a {{HTMLElement("col")}} element, you need to select the cells of the column using a `td:nth-last-child(n)` or similar (`n` is the column number, counting from the end).

## Value

The possible values are:

- `left`
- : Align the text to the left. Use `text-align: left` instead.
- : Align the text to the left. Use `text-align: left` applied directly to the {{td}} or {{th}} instead.
- `right`
- : Align the text to the right. Use `text-align: right` instead.
- : Align the text to the right. Use `text-align: right` applied directly to the `<td>` or `<th>` instead.
- `center`
- : Center the text in the cell. Use `text-align: center` instead.

Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/css/_colon_nth-child/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,12 +454,12 @@ tr :nth-child(1) {
background-color: silver;
}

tbody tr td:nth-child(2) {
tbody tr :nth-child(2) {
text-align: center;
vertical-align: middle;
}

tbody tr td:nth-child(3) {
tbody tr :nth-child(3) {
text-align: right;
vertical-align: top;
background-color: tomato;
Expand Down