AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP, SQL

HTML Table Style Border Width


<< Previous Page
HTML image size link background
Next Page >>
HTML Button link & Style

HTML Tutorial » HTML table style border width

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.

Syntax:

HTML table
<table>
<tr>
<th>title_text</th> <!-- each line one column -->
...
...
...
</tr>
<tr>
<td>content</td> <!-- each line one column -->
...
...
...
</tr>
</table>

 

HTML table style - examples

An HTML table is defined with the <table> tag where we add style with: width, border color and more .

How we use style = "width:100%; border:#C30 thin solid; text-align:center" to add border around table.

Example
  <!DOCTYPE html>
<html>
<head>
<title>HTML style border colored around table</title>
</head>

<body>
<h1>HTML style border colored around table</h1>
<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>

</body>
</html>
Note: In the above example I used inline CSS, avoid this and use external CSS instead.

Related subjects:
HTML Table Style HTML Table Width Table Rowspan Colspan

 

HTML Table Colspan and Rowspan Attributes

If 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.

Example Table Colspan and Rowspan
  <!DOCTYPE html>
<html>
<head>
<title>HTML Table Colspan and Rowspan Attributes</title>
</head>

<body>
<h1>HTML table Colspan and Rowspan Attributes</h1>
<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>

 

HTML Table Height and Width

You can specify table width and tabele height in pixels or percentage of available screen area.

Example
  <!DOCTYPE html>
<html>
<head>
<title>HTML Table Height and Width</title>
</head>

<body>
<h1>HTML Table Height and Width</h1>
<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>

</body>
</html>

Chapter Summary

HTML <table> - define a table
HTML <tr> - define a table row
HTML <td> - define a table data
HTML <th> - define a table heading
Use the HTML <caption> - define a table caption

Colspan attribute makes a cell span many columns
Rowspan attribute makes a cell span many rows
Id attribute uniquely define one table

<< Previous Page
HTML image size link background
Next Page >>
HTML Button link & Style

 



HTML table, border, width, style, center, color, colspan, tag, rowspan, example, tag, css
HTML table column width, style, header, border style, width, padding, background collor
HTML table style, HTML border, width and height - html tutorial

Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


HTML Img Background
HTML Image Link
HTML Image Size
HTML Text Style
HTML Text Align
HTML Text Size
HTML Text Color Style
HTML Text Color
HTML Table Color
HTML Table Row Colspan
HTML Table Width
HTML Table Style
HTML Table Border
HTML Table
HTML Font Face
HTML Font Size
HTML Font Color
HTML Headings
HTML div border color
HTML div class
HTML class container
HTML form action
HTML comment
HTML link new tab
HTML link underline
HTML link tag
HTML button action
HTML button onclick
HTML button link
HTML table style
HTML image
HTML colors
HTML div style
Text, paragraf in HTML
HTML Tags Attributes
HTML - Elements
HTML Introduction
Home HTML Tutorial
Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


Upload Image, display, edit and delete i...
Login Form with Image background...
How to Create an Image with Transparent ...
Portfolio Gallery Website with filtering...
Simple pagination script PHP MySQLi...
Center Image in div...
Image Hover Overlay Fade...
Sticky image / element / div on scroll...
Responsive images...
Create rounded image in HTML CSS...
Add border around image...
Position Text Over an Image HTML CSS res...
Create a Slideshow Images Gallery...
Create a Sticky Sidebar...
Search bar using CSS HTML...
Shrink Navigation Menu on Scroll...
How to Create Accordion HTML Templates...
Dropdown menu in the navigation bar...
Responsive Top Navigation Bar with mobil...
Split horizontal navigation bar...