HTML table tag tutorial (3): width and height attributes WIDTH, HEIGHT

HTML table tag tutorial (3): width and height attributes WIDTH, HEIGHT

By default, the width and height of the table are automatically adjusted according to the content. We can also manually set the width and height of the table.
Basic syntax
<TABLE WIDTH=VALUE HEIGHT=VALUE>
Syntax explanation <br />The width of the table is defined by the WIDTH attribute, and the height of the table is defined by the HEIGHT attribute. The unit is pixel or percentage. If it is a percentage, it can be divided into two cases: if it is not a nested table, the percentage is relative to the browser window; if it is a nested table, the percentage is relative to the cell width where the nested table is located.
File example: 10-3.htm
Set the width and height of the table.
01 <!-- ------------------------------ -->
02 <!-- File example: 10-3.htm -->
03 <!-- File Description: Set the width and height of the table-->
04 <!-- ------------------------------ -->
05 <HTML>
06 <HEAD>
07 <TITLE>Set the width and height of the table</TITLE>
08 </HEAD>
09 <BODY>
10 <H1>Mainstream web design software</H1>
11 <TABLE BORDER=1 WIDTH=400 HEIGHT=100>
12 <TR>
13 <TD>Web Graphics Software</TD><TD>Fireworks</TD>
14 </TR>
15 <TR>
16 <TD>Web page creation software</TD><TD>Dreamweaver</TD>
17 </TR>
18 <TR>
19 <TD>Web animation software</TD><TD>Flash</TD>
20 </TR>
21 </TABLE>
22 </BODY>
23 </HTML>
File Description <br />Line 11 defines the table's width as 400 pixels and its height as 100 pixels.

<<:  Solution to Nginx SSL certificate configuration error

>>:  Native JS to achieve image marquee effects

Recommend

How to add default time to a field in MySQL

Date type differences and uses MySQL has five dat...

Resolving MySQL implicit conversion issues

1. Problem Description root@mysqldb 22:12: [xucl]...

CSS Naming: BEM, scoped CSS, CSS modules and CSS-in-JS explained

The scope of css is global. As the project gets b...

Steps to deploy Spring Boot project using Docker

Table of contents Create a simple springboot proj...

Solution to the MySQL server has gone away error

MySQL server has gone away issue in PHP 1. Backgr...

JQuery implements hiding and displaying animation effects

This article shares the specific code of JQuery t...

Detailed explanation of using echarts map in angular

Table of contents Initialization of echart app-ba...

Add a floating prompt for the header icon in the ElementUI table

This article mainly introduces how to add floatin...

Native JavaScript message board

This article shares the specific code of JavaScri...

HTML Tutorial: Collection of commonly used HTML tags (4)

These introduced HTML tags do not necessarily ful...

Detailed explanation of mkdir command in Linux learning

Table of contents Preface 1. Basic knowledge of f...

Make your website run fast

Does performance really matter? Performance is im...

A brief analysis of the differences between px, rem, em, vh, and vw in CSS

Absolute length px px is the pixel value, which i...