Which of the following HTML elements is used to create a table title?
IntroductionA table is a set of data organized by rows and columns. Tables are useful for displaying connections between data types, such as products and their cost, employment and dates employed, or flights and departure times. In this tutorial, you will create a table using HTML, customize it by adding a desired amount of rows and columns, and add row and column headings to make your table easier to read. Show
Prerequisites
Fundamentals of HTML tablesAn HTML table is created with an opening Table row As an example, here is a table that has two rows and three columns: To explore how HTML tables works in practice, paste the code snippet above into the Save and reload the file in the browser to check your results. (For instructions on loading
the file in your browser, please visit this step of our tutorial on HTML Elements.) Your webpage should now have a table with three columns and two rows: To add an additional row, add the highlighted Save your results and check them in your browser. You should receive something like this: To add another column, try adding an additional table data Save your results and check them in your browser. Your webpage should display a table with three rows and four
columns: In general, tables should be styled with CSS. If you do not know CSS, you can add some light styling using HTML by
adding the attributes to the Add the highlighted border attribute to your table and checking your results in the browser. (You can clear your Headings can be added to rows and columns to make tables easier to read. Table headings are automatically styled with bold and centered text to visually distinguish them from table data. Headings also make tables more accessible as they help individuals using screen readers navigate
table data. Headings are added by using opening and closing Clear the Save the Your webpage should display a single row of column headers. Note that the first column header is empty. You may add a column header here if you like. To add row headers, you must add opening and closing Save the You should now have a table with with three column headings and three row headings. In this tutorial, you have created an HTML table, added additional rows and columns, and created headings for rows and columns. If you are interested in learning more about HTML, you can check our our tutorial series How To Build a Website With HTML. To learn about how to use CSS to style HTML elements (including tables), please visit our tutorial series
How To Build a Website With CSS. |