分步表單如何實現 html_HTML表格入門的分步指南

分步表單如何實現 html

by Abhishek Jakhar

通過阿比舍克·賈卡(Abhishek Jakhar)

HTML表格入門的分步指南 (A step-by-step guide to getting started with HTML tables)

總覽 (Overview)

The web is filled with information like football scores, cricket scores, lists of employee names and email addresses. HTML tables enable you to display information in what is commonly known as tabular data.

網絡上充斥著諸如足球比分,板球比分,員工姓名列表和電子郵件地址之類的信息。 HTML表使您能夠顯示通常稱為表格數據的信息

NOTE: I have already added the Styling using CSS, so my elements will look different. But they will work in exactly the same way.

注意:我已經使用CSS添加了樣式,所以我的元素看起來會有所不同。 但是它們將以完全相同的方式工作。

If you want to make your elements look like mine then, you can find my CSS file in the links given below:

如果要使您的元素看起來像我的元素,則可以在下面給出的鏈接中找到我CSS文件:

If you want to make your elements look like mine then, you can find my CSS file in the links given below:CSS: https://gist.github.com/abhishekjakhar/2ea51dfc0dcf6f6ed0d44ac0e72f9c54

如果要使您的元素看起來像我的元素,則可以在下面的鏈接中找到我CSS文件: CSS: https : //gist.github.com/abhishekjakhar/2ea51dfc0dcf6f6ed0d44ac0e72f9c54

基本表 (Basic Table)

We can create an HTML table using the table element. It has an opening and closing tag, and it wraps all the table rows and table cells inside of it.

我們可以使用table元素創建一個HTML表。 它具有一個開始和結束標簽,并且將所有表行表單元格包裝在其中。

<table></table>

Now, let’s type a table row. Tables are made up of rows of information that go across the page. A <tr> element is used to create a table row.

現在,讓我們鍵入一個表格行。 表格由遍及頁面的信息行組成。 < tr>元素用于創建表行。

However, there is no element for the table column. Table columns depend on how many table cells are inside each row. A <td> element is used to create a table cell. So basically the number of <td> elements you will add inside the <tr> element is the exact same number of columns you will get inside your table row.

但是,表列沒有元素。 表列取決于每行中有多少個表單元格< td>元素用于創建表格單元。 所以基本上麻木呃華氏度 <TD>元素,您將添加插件 IDE中的<tr>元素是完全相同的列數,你會得到你的表行內。

To recap:

回顧一下:

  • <table>: The table element represents data in a series of rows and columns. Tables should only be used for displaying tabular data, and never for page layout.

    <table >:table元素表示一系列行和列中的數據。 表只能用于顯示表格數據,而不能用于頁面布局。

  • <tr>: The table row element defines a row of cells in a table. Table rows can be filled with table cells and table header cells.

    <tr >:表格行元素定義表格中的單元格行。 表格行可以用表格單元格和表格標題單元格填充。

  • <td>: The table cell element contains data and represents a single table cell. Each table cell should be inside a table row.

    <td >:表單元格元素包含數據并代表單個表單元格。 每個表格單元格應在表格行內。

Note: <table> elements have no attributes. If you’ve worked with tables before, you may have used some attributes in the past. However, they are all now deprecated.

注意: <table>元素沒有屬性。 如果您以前使用過表,則過去可能使用過一些屬性。 但是,它們現在都已棄用。

表標題元素 (Table Header Element)

We’ve created a basic table, but it’s not clear that our first row in the table is actually an attempt to label each of our columns. Right now, the first row simply looks like another row in our table.

我們已經創建了一個基本表,但是尚不清楚表中的第一行實際上是對每個列進行標記的嘗試。 現在,第一行看起來就像我們表中的另一行。

We can use a table header element on each of these three columns to tell the browser, search engine crawlers, and screen readers that these are actually headers and not just regular data.

我們可以在這三列中的每一個上使用一個表頭元素 ,以告知瀏覽器,搜索引擎搜尋器和屏幕閱讀器這些實際上是頭,而不僅僅是常規數據。

Now we will be changing table cells in the first row to a table headers cell. To do that we will replace <td&gt; by <th>.

現在,我們將第一行中的表格單元更改為表格標題單元。 為此,我們將替換< td&g t; b y <th>。

桌子頭和身體 (Table Head & Body)

Similar to the structure of our HTML document, where we have a head and a body, we can also add a head and a body to our table. We will definitely not use the same HTML elements because then the syntax will become invalid. For the table, we have <thead> for the head and &lt;tbody&gt; for the body.

與HTML文檔的結構類似,在該結構中我們有一個頭和一個主體,我們也可以在表中添加一個頭和一個主體。 我們絕對不會使用相同HTML元素,因為這樣語法將變得無效。 對于該表中,我們有<廣告 > FO 第r個 ?HEA d和&L T; TBODY&GT; 為身體。

  • <thead> — The table head element (not to be confused with the table header cell element) defines a set of rows that make up the header of a table.

    <the ad> —表頭元素(不要與表頭單元格元素混淆)定義了構成表頭的一組行。

  • <tbody> — The table body element defines one or more rows that make up the primary contents (or “body”) of a table.

    <tbo dy> —表格主體元素定義了構成表格主要內容(或“主體”)的一行或多行。

桌腳元素 (Table Foot Element)

We have a table head and a table body element. So of course, there’s a table foot element as well. But the question is what is the point of table footer element when we already have the table headers that label columns?

我們有一個表頭和一個表主體元素。 因此,當然還有桌腳元素。 但是問題是,當我們已經有了標簽列的表頭時,表腳元素的意義是什么?

In general, a table footer element should contain a summary of the table. This might be some final cells containing sums, totals and averages for each column. It might also contain some meta information like copyright information or the source of data within a table.

通常,表頁腳元素應包含表的摘要。 這可能是一些最終單元格,其中包含每列的總和,總計和平均值。 它也可能包含一些元信息,例如版權信息或表中的數據源。

Now, you would think that the table footer would go at the bottom of the table. However, it actually should go right after the table head element and just before the table body element.

現在,您會認為表格頁腳將位于表格底部。 然而,它實際上應該在表頭元素之后只是 表體元素之前去。

  • <tfoot&gt; — The table footer element defines a set of rows summarizing the columns of the table.

    <tfoot > —表腳元素定義了一組匯總表各列的行。

字幕元素 (Caption Element)

This element is basically a title for the table, and it should come immediately after the opening table tag. This is nice to add because it quickly summarizes what a table might contain.

這個元素基本上是表格的標題,應該在開始表格標簽之后。 添加它很不錯,因為它可以快速匯總表可能包含的內容。

Now we have covered the essentials of table elements in HTML.

現在,我們已經介紹了HTML中表格元素的要點。

You can learn more about the tables in the links given below.

您可以在下面的鏈接中了解有關表格的更多信息。

HTML Table BasicsThat just about wraps up the basics of HTML Tables.developer.mozilla.orgHTML Table Advanced There are a few other things you could learn about HTML Tables.developer.mozilla.org

HTML表基礎知識 幾乎總結了HTML表的基礎知識。 developer.mozilla.org HTML Table Advanced 您還可以了解HTML Tables的其他一些知識。 developer.mozilla.org

I hope you’ve found this post informative and helpful. I would love to hear your feedback!

希望您發現這篇文章對您有幫助。 我希望聽到您的反饋!

Thank you for reading!

感謝您的閱讀!

翻譯自: https://www.freecodecamp.org/news/a-step-by-step-guide-to-getting-started-with-html-tables-7f43b18f962b/

分步表單如何實現 html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/392563.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/392563.shtml
英文地址,請注明出處:http://en.pswp.cn/news/392563.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

laravel mysql pdo,更改Laravel中的基本PDO配置

My shared web host have some problems with query prepares and I want to enable PDOs emulated prepares, theres no option for this in the config\database.php.Is there any way I can do that in Laravel?解決方案You can add an "options" array to add o…

Java多線程-工具篇-BlockingQueue

Java多線程-工具篇-BlockingQueue 轉載 http://www.cnblogs.com/jackyuj/archive/2010/11/24/1886553.html 這也是我們在多線程環境下&#xff0c;為什么需要BlockingQueue的原因。作為BlockingQueue的使用者&#xff0c;我們再也不需要關心什么時候需要阻塞線程&#xff0c;什…

leetcode 204. 計數質數

統計所有小于非負整數 n 的質數的數量。 示例 1&#xff1a; 輸入&#xff1a;n 10 輸出&#xff1a;4 解釋&#xff1a;小于 10 的質數一共有 4 個, 它們是 2, 3, 5, 7 。 解題思路 大于等于5的質數一定和6的倍數相鄰。例如5和7&#xff0c;11和13,17和19等等&#xff1b…

JAVA 網絡編程小記

在進行JAVA網絡編程時&#xff0c;發現寫入的數據對方等200ms左右才會收到。起初認為是JAVA自已進行了 Cache。進行flush也沒有效果。查看JDK代碼&#xff0c;Write操作直接調用的native方法&#xff0c;說明JAVA層面并沒有緩存。再看flush&#xff0c;只是一個空方法. FileOut…

vue生成靜態js文件_如何立即使用Vue.js生成靜態網站

vue生成靜態js文件by Ond?ej Polesn通過Ond?ejPolesn 如何立即使用Vue.js生成靜態網站 (How to generate a static website with Vue.js in no time) You have decided to build a static site, but where do you start? How do you select the right tool for the job wit…

查看文件夾大小的4種方法,總有一種是你喜歡的

有必要檢查文件夾的大小,以確定它們是否占用了太多的存儲空間。此外,如果你通過互聯網或其他存儲設備傳輸文件夾,還需要查看文件夾大小。 幸運的是,在Windows設備上查看文件夾大小非常容易。窗口中提供了圖形化和基于命令行的應用程序,為你提供了多種方法。 如何在Windo…

Python 獲取服務器的CPU個數

在使用gunicorn時&#xff0c;需要設置workers&#xff0c; 例如&#xff1a; gunicorn --workers3 app:app -b 0.0.0.0:9000 其中&#xff0c;worker的數量并不是越多越好&#xff0c;推薦值是CPU的個數x21&#xff0c; CPU個數使用如下的方式獲取&#xff1a; python -c impo…

多種數據庫連接工具_20多種熱門數據工具及其不具備的功能

多種數據庫連接工具In the past few months, the data ecosystem has continued to burgeon as some parts of the stack consolidate and as new challenges arise. Our first attempt to help stakeholders navigate this ecosystem highlighted 25 Hot New Data Tools and W…

怎么連接 mysql_怎樣連接連接數據庫

這個博客是為了說明怎么連接數據庫第一步&#xff1a;肯定是要下載數據庫&#xff0c;本人用的SqlServer2008&#xff0c;是從別人的U盤中拷來的。第二步&#xff1a;數據庫的登錄方式設置為混合登錄&#xff0c;步驟如下&#xff1a;1.打開數據庫這是數據庫界面&#xff0c;要…

webstorm環境安裝配置(less+autoprefixer)

node安裝&#xff1a; 參考地址&#xff1a;http://www.runoob.com/nodejs/nodejs-install-setup.html 1.下載node安裝包并完成安裝 2.在開始菜單打開node 3.查看是否安裝完成&#xff08;npm是node自帶安裝的&#xff09; 命令&#xff1a;node -v npm -v less安裝&#xff1a…

leetcode 659. 分割數組為連續子序列(貪心算法)

給你一個按升序排序的整數數組 num&#xff08;可能包含重復數字&#xff09;&#xff0c;請你將它們分割成一個或多個子序列&#xff0c;其中每個子序列都由連續整數組成且長度至少為 3 。 如果可以完成上述分割&#xff0c;則返回 true &#xff1b;否則&#xff0c;返回 fa…

將JAVA編譯為EXE的幾種方法

< DOCTYPE html PUBLIC -WCDTD XHTML StrictEN httpwwwworgTRxhtmlDTDxhtml-strictdtd> 將JAVA編譯為EXE的幾種方法 -------------------------------------------------------------------------------- 將Java應用程序本地編譯為EXE的幾種方法(建議使用JOVE和JET)  a.…

文本訓練集_訓練文本中的不穩定性

文本訓練集介紹 (Introduction) In text generation, conventionally, maximum likelihood estimation is used to train a model to generate a text one token at a time. Each generated token will be compared against the ground-truth data. If any token is different …

山東省賽 傳遞閉包

https://vjudge.net/contest/311348#problem/A 思路&#xff1a;用floyd傳遞閉包處理點與點之間的關系&#xff0c;之后開數組記錄每個數字比它大的個數和小的個數&#xff0c;如果這個個數超過n/2那么它不可能作為中位數&#xff0c;其他的都有可能。 #include<bits/stdc.h…

如何使用動態工具提示構建React Native圖表

by Vikrant Negi通過Vikrant Negi 如何使用動態工具提示構建React Native圖表 (How to build React Native charts with dynamic tooltips) Creating charts, be it on the web or on mobile apps, has always been an interesting and challenging task especially in React …

如何解決ajax跨域問題(轉)

由 于此前很少寫前端的代碼(哈哈&#xff0c;不合格的程序員啊)&#xff0c;最近項目中用到json作為系統間交互的手段&#xff0c;自然就伴隨著眾多ajax請求&#xff0c;隨之而來的就是要解決 ajax的跨域問題。本篇將講述一個小白從遇到跨域不知道是跨域問題&#xff0c;到知道…

mysql并發錯誤_又談php+mysql并發數據出錯問題

最近&#xff0c;項目中的所有crond定時盡量取消&#xff0c;改成觸發式。比如每日6點清理數據。原來的邏輯&#xff0c;寫一個crond定時搞定現在改為觸發式6點之后第一個玩家/用戶 進入&#xff0c;才開始清理數據。出現了一個問題1 如何確保第一個玩家觸發&#xff1f;updat…

leetcode 621. 任務調度器(貪心算法)

給你一個用字符數組 tasks 表示的 CPU 需要執行的任務列表。其中每個字母表示一種不同種類的任務。任務可以以任意順序執行&#xff0c;并且每個任務都可以在 1 個單位時間內執行完。在任何一個單位時間&#xff0c;CPU 可以完成一個任務&#xff0c;或者處于待命狀態。 然而&…

英國腦科學領域_來自英國A級算法崩潰的數據科學家的4課

英國腦科學領域In the UK, families, educators, and government officials are in an uproar about the effects of a new algorithm for scoring “A-levels,” the advanced level qualifications used to evaluate students’ knowledge of specific subjects in preparati…

MVC發布后項目存在于根目錄中的子目錄中時的css與js、圖片路徑問題

加載固定資源js與css <script src"Url.Content("~/Scripts/js/jquery.min.js")" type"text/javascript"></script> <link href"Url.Content("~/Content/css/shop.css")" rel"stylesheet" type&quo…