Về mặt ngữ nghĩa, việc bạn sử dụng td
thay vì th
sẽ không tạo ra bất kỳ sự khác biệt nào đối với bạn, điều đó sẽ giúp bạn hoàn thành công việc một cách vui vẻ, nhưng, để phân biệt chúng, chúng tôi sử dụng th
,
1,
2, v.v., giống như chúng ta có thể sử dụng
3
Ngoài ra, các công cụ tìm kiếm hiểu rằng tài liệu của bạn chứa những gì, chẳng hạn như bạn sử dụng
5, vì vậy, bất kể bạn tạo kiểu cho văn bản
5 của mình như thế nào, các công cụ tìm kiếm sẽ nhận được manh mối rằng này, từ trong
5 được nhấn mạnh, vì vậy nó quan trọng trong
Nó giống như bạn đang nói với bác sĩ, rằng cơ thể tôi đang đau, nhưng nếu bạn mô tả đau ở phần nào của td
2, sẽ giúp bác sĩ dễ dàng phán đoán và khắc phục vấn đề dễ dàng
Như vậy, với logic tương tự, nếu bạn xác định các tiêu đề của td
3 bằng cách sử dụng th
sẽ hợp lý hơn thay vì sử dụng td
, sẽ giúp các công cụ tìm kiếm biết nội dung của bạn một cách tốt hơn, trình đọc màn hình sẽ đọc dữ liệu theo cách khác, các trình duyệt
xin chào @vakadavamsi,
Sự khác biệt cơ bản giữa các thẻ < th > và < td > là,
Thẻ < th > được sử dụng .
Ví dụ trong hình đã cho, “Tên” là < th >, i. e nó là tiêu đề của các mục sẽ được thực hiện dưới nó.
However the tag < td > represents the data filled in the rows. Example the various names and age given under the “Name” and “Age” headings.
Hy vọng truy vấn / nghi ngờ của bạn được giải quyết
Các thẻ khác nhau được sử dụng để tạo bảng trong trang web và những thẻ được sử dụng để tạo sẽ được thảo luận sau đây
thẻ - Một bảng được tạo bằng cách sử dụng thẻ. Trong phần tử, bảng được xây dựng theo từng hàng. Một hàng hiện diện trong một thẻ, viết tắt của 'bảng hàng'. Và mỗi ô sau đó được viết bên trong thành phần hàng bằng cách sử dụng thẻ – Thẻ này được sử dụng để chứa từng hàng trong một bảng. Thông tin xuất hiện trong đó xuất hiện trên cùng một hàng
thẻ, viết tắt của 'dữ liệu bảng'. Mỗi ô phải có aor atag để hiển thị chính xác. Một ví dụ được hiển thị Mã HTML Hàng 1, Cột 1 Hàng 1, Cột 2 Hàng 2, Cột 1 Hàng 2, Cột 2
Đầu ra trình duyệt
thẻ - Mỗi ô trong bảng được cung cấp bởi atag cho các ô có dữ liệu hoặc atag cho các ô chứa tiêu đề bảng. Nội dung của phần tử, thường được hiển thị căn trái. Tập hợp các thuộc tính của thẻ áp dụng cho một ô mang nó
thẻ – Tiêu đề cho một bảng có thể được xác định bằng cách sử dụng thẻ. Nó thay thế thẻ ở hàng trên cùng của bảng thường được sử dụng để biểu thị tiêu đề bảng. Nó cũng có thể được sử dụng ở nơi khác trong bảng để nhấn mạnh. Mã HTML Tiêu đề 1 Tiêu đề 2 Ô 1 Ô 2 Đầu ra của trình duyệt
Quay lại Hướng dẫn
This HTML tutorial explains how to use the HTML element called the tag with syntax and examples.
Sự miêu tả
The HTML tag defines a header cell that can appear in the first row of an HTML table. Browsers traditionally render the text found within the tag as bold, center-aligned text. This tag is also commonly referred to as the element.
cú pháp
In HTML, the syntax for the tag is: [example of a table where the first row contains the header cells]
Or, the tag can be defined within the optional tag as follows: [which will be discussed more in the tag tutorial]
Đầu ra mẫu
Thuộc tính
In addition to the Global Attributes, the following is a list of attributes that are specific to the tag:
AttributeDescriptionHTML CompatibilityabbrShort description for contents of cellObsolete in HTML5alignHorizontal alignment of text. It can be one of the following values: left, center, right, justify, charDeprecated in HTML 4.01, Obsolete in HTML5, use CSSaxisList of strings, separated by spaces. Use scope attribute instead.Obsolete in HTML5bgcolorBackground color of cellNon-standard, use CSScharSet the character to align the cells in a columnDeprecated in HTML 4.01, Obsolete in HTML5charoffNumber of characters to offset column data from the alignment characters [in char attribute]Deprecated in HTML 4.01, Obsolete in HTML5colspanNumber of columns the cell extends [Default is 1, max value is 1000]HTML 4.01, HTML5headersList of strings [separated by spaces] corresponding to the id attribute of the element that it applies toHTML 4.01, HTML5rowspanNumber of rows that the cell extends [Default is 1, max value is 65534]HTML 4.01, HTML5scopeList of strings, separated by spacesObsolete in HTML5valignVertical alignment of text. It can be one of the following values: baseline, bottom, middle, topDeprecated in HTML 4.01, Obsolete in HTML5, use CSS
Ghi chú
- The HTML element is found in an HTML table within the tag.
- The tag defines the header cells in the table which are displayed as bold, center-aligned text.
- The tag is a header cell that can appear in the first row of an HTML table. The tag can be defined within the tag, which has some browser advantages, but this is optional.
- The
tag defines the table rows. There must be at least one row in the table.- The
tag defines the standard cells in the table which are displayed as normal-weight, left-aligned text.tính tương thích của trình duyệt webThe tag is compatible with the following browsers: - Trình duyệt Chrome
- Android
- Firefox [Tắc kè]
- Firefox Di động [Tắc kè]
- Internet Explorer [IE]
- Cạnh di động
- Ô-pê-ra
- Opera di động
- Safari [WebKit]
- Safari di động
Thí dụWe will discuss the tag below, exploring examples of how to use the tag in HTML5, HTML 4.01 Transitional, XHTML 1.0 Transitional, XHTML 1.0 Strict, and XHTML 1.1. Tài liệu HTML5If you created a new web page in HTML5, your tag might look like this:
HTML5 Example by www.techonthenet.com
Column 1 Heading
Column 2 Heading
Column 3 Heading
Data in Column 1, Row 2 |
Data in Column 2, Row 2 |
Data in Column 3, Row 2 |
In this HTML5 Document example, we have created a table using the tag that has 3 columns and 2 rows. Row 1 of the table has 3 table heading cells defined using the tag. Row 2 of the table uses the tag to define standard table cells.HTML4. 01 Văn bản chuyển tiếpIf you created a new web page in HTML 4.01 Transitional, your tag might look like this:
HTML 4.01 Transitional Example by www.techonthenet.com
Column 1 Heading
Column 2 Heading
Column 3 Heading
Data in Column 1, Row 2 |
Data in Column 2, Row 2 |
Data in Column 3, Row 2 |
In this HTML 4.01 Transitional Document example, we have created a table using the tag that has 3 columns and 2 rows. Row 1 of the table has 3 table heading cells defined using the tag. Row 2 of the table uses the tag to define standard table cells.XHTML 1. 0 Tài liệu chuyển tiếpIf you created a new web page in XHTML 1.0 Transitional, your tag might look like this:
XHMTL 1.0 Transitional Example by www.techonthenet.com
Column 1 Heading
Column 2 Heading
Column 3 Heading
Data in Column 1, Row 2 |
Data in Column 2, Row 2 |
Data in Column 3, Row 2 |
In this XHTML 1.0 Transitional Document example, we have created a table using the tag that has 3 columns and 2 rows. Row 1 of the table has 3 table heading cells defined using the tag. Row 2 of the table uses the tag to define standard table cells.XHTML 1. 0 Tài liệu nghiêm ngặtIf you created a new web page in XHTML 1.0 Strict, your tag might look like this:
XHTML 1.0 Strict Example by www.techonthenet.com
Column 1 Heading
Column 2 Heading
Column 3 Heading
Data in Column 1, Row 2 |
Data in Column 2, Row 2 |
Data in Column 3, Row 2 |
In this XHTML 1.0 Strict Document example, we have created a table using the tag that has 3 columns and 2 rows. Row 1 of the table has 3 table heading cells defined using the tag. Row 2 of the table uses the tag to define standard table cells.XHTML 1. 1 tài liệuIf you created a new web page in XHTML 1.1, your tag might look like this:
XHTML 1.1 Example by www.techonthenet.com
Column 1 Heading
Column 2 Heading
Column 3 Heading
Data in Column 1, Row 2 |
Data in Column 2, Row 2 |
Data in Column 3, Row 2 |
Trong XHTML 1 này. 1 Ví dụ về tài liệu, chúng ta đã tạo một bảng bằng cách sử dụng thẻ có 3 cột và 2 hàng. Hàng 1 của bảng có 3 ô tiêu đề bảng được xác định bằng thẻ. Hàng 2 của bảng sử dụng thẻ để xác định các ô của bảng tiêu chuẩn
TD TR và TH trong HTML là gì?
Một bảng HTML bao gồm một phần tử Phần tử .
Thẻ TD và TR dùng để làm gì?
Thẻ Thẻ . Phải có ít nhất một hàng trong bảng. Thẻ
| | | | |