HOME | PHP Tutorial | CSS
facebook icon
AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP
PHP Tutorial

PHP forms
HTML Tutorial

CSS Tutorial

HTML table

The HTML table allows to arrange all data on the page like, text, images, links, forms, etc. into rows and columns of cells.
The HTML tables are created using the <table> tag, <tr> tag is used to create table rows and <td> tag is used to create data cells. The elements under <td> are regular left aligned by default.

HTML table border, HTML table style, table width

An HTML table is defined with the <table> tag where we add style with: width, border color and more .
Example 1:
<table style="width:100%; border:#C30 thin solid; text-align:center">
  <tr>
    <th>Firstname</th>
    <th>Lastname</th> 
    <th>Age</th>
  </tr>
  <tr>
    <td>Jilly</td>
    <td>Ford</td> 
    <td>55</td>
  </tr>
  <tr>
    <td>Eva</td>
    <td>Sonjak</td> 
    <td>48</td>
  </tr>
</table>
Note: HTML image alt attribute. The value of the alt attribute from above example 1 should describe the image what it looks like.
The html cod above will display this HTML table result:
HTML table border, HTML table style, table width, text-align:center result.
     
Firstname LastnameAge
Jilly Ford55
Evea Sonjak48

HTML table Colspan and Rowspan Attributes

Yf you want to merge two or more columns into a single column you will use colspan attribute. If you want to merge two or more rows you will use rowspan.
Example2:
<!DOCTYPE html>
<html>
<head>
<title>HTML Table Colspan/Rowspan</title>
</head>
<body>
<table border = "1">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
<tr>
<td rowspan = "2">Row 1 Cell 1</td>
<td>Row 1 Cell 2</td>
<td>Row 1 Cell 3</td>
</tr>
<tr>
<td>Row 2 Cell 2</td>
<td>Row 2 Cell 3</td>
</tr>
<tr>
<td colspan = "3">Row 3 Cell 1</td>
</tr>
</table>
</body>
</html>

This HTML code will produce the following result −
Column 1 Column 2 Column 3
Row 1 Cell 1 Row 1 Cell 2 Row 1 Cell 3
Row 2 Cell 2 Row 2 Cell 3
Row 3 Cell 1

HTML Table Height and Width

You can specify table width and tabele height in pixels or percentage of available screen area.
Example 3:
<table border = "2" width = "450" height = "160">
<tr>
<td>Row 1, Column 1</td>
<td>Row 1, Column 2</td>
</tr>
<tr>
<td>Row 2, Column 1</td>
<td>Row 2, Column 2</td>
</tr>
</table>

This HTML code will produce the following result −
Row 1, Column 1 Row 1, Column 2
Row 2, Column 1 Row 2, Column 2

HTML table, border, width, style, center, color, colspan, tag, rowspan, example, tag, css HTML table style, HTML border, width and height - html tutorial

3346. HTML div class tag attribute, html tutorial
HTML div class tag attribute html tutorial
https://www.agernic.com/html-tutorial/html-div-class-tag-attribute.html

2117. HTML Tutorial - Hexadecimal, RGB color codes, inserting colors into html pages / safe colors
Hexadecimal colors and rgb colors. inserting colors
https://tutorialehtml.com/en/html-tutorial-color-codes/

2113. HTML Tutorial - Background
A web tutorial about background and background colos and images
https://tutorialehtml.com/en/html-tutorial-background/

2125. HTML Tutorial - Inserting sounds and music into HTML pages
Inserting audio strem sounds and music into html pages.
https://tutorialehtml.com/en/html-tutorial-embed-audio/

2186. HTML Tutorial - Verwendung des Div-Tag
Erstellen einer Webseite mit div-Tag. Wie man div verwendet, um einfache Layouts oder HTML-Vorlagen für Ihre Inhalte zu erstellen.
https://tutorialehtml.com/de/html-div-container/

3208. HTML link tag with example, html tutorial
HTML link tag with example html tutorial
https://www.agernic.com/html-tutorial/html-link-tag-with-example.html

Your add here
PHP strlen() function

PHP rtrim() function

PHP str_split() function

PHP lcfirst() function

PHP html_entity_decode() function

PHP implode() function

PHP similar_text() function

PHP wordwrap() function

PHP printf() function

PHP htmlspecialchars() function

PHP isset() Function

PHP define() function

PHP str_repeat() function

PHP strip_tags() function

PHP print() function

PHP strtolower() function

PHP Data Types
PHP delete an element from an array
HTML Text Style
HTML List Bullet
Insert into SQL - Insert into table SQL - Insert data in sql
HTML div style - div style class