首页 > 其他分享 >HTML_04_Table

HTML_04_Table

时间:2023-02-13 21:44:47浏览次数:41  
标签:Tickets None 895.20 04 January 410.50 250.00 HTML Table

Table

1. Basic table structure

<table> </table>

​ create a table

<tr> </tr>

​ indicate the start of each row

<td> </td>

​ each cell in a roll

<table>
    <tr>
    	<td>10</td>
        <td>20</td>
        <td>30</td>
    </tr>
    <tr>
    	<td>26</td>
        <td>27</td>
        <td>28</td>
    </tr>
    <tr>
    	<td>57</td>
        <td>56</td>
        <td>55</td>
    </tr>
</table>
10 20 30
26 27 28
57 56 55

2. Table headings

<th> </th>

​ present the heading

<th scope="col"> </th>

​ a heading for a column

<th scope="row"> </th>

​ a heading for a row

<table>
    <tr>
        <th></th>
		<th scope="col">Wednesday</th>
        <th scope="col">Thursday</th>
    </tr>
    <tr>
    	<th scope="row">Tickets sold</th>
        <td>120</td>
        <td>135</td>
    </tr>
     <tr>
    	<th scope="row">Tickets sales</th>
        <td>$600</td>

    </tr>
</table>

3. Spanning Columns

<td rowspan="2">

<td colspan="2">

<table>
    <tr>
    <th></th>
        <th scope="col">Jerry</th>
        <th scope="col">Mike</th>
        <th scope="col">David</th>
    </tr>
    <tr>
    	<th scope="row">Rent</th>
        <td rowspan="2">None</td>
        <td>$100</td>
        <td>$110</td>
    </tr>
       <tr>
    	<th scope="row">Energy Cost</th>
		<td colspan="2">None</td>
    </tr>
</table>
Wednesday Thursday
Tickets sold 120 135
Tickets sales $600 $750
td>$110
Jerry Mike David
Rent None $100
Energy Cost None

4. Long table

<table>
    <thead>
    	...
    </thead>
    <tbody>
    	...
    </tbody>
    <tfoot>
    	...
    </tfoot>
</table>
<table>
    <thead>
        <tr>
            <th>Date</th>
            <th>Income</th>
            <th>Expenditure</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <th>1st January</th>
            <td>250</td>
            <td>36</td>
        </tr>
        <tr>
            <th>2nd January</th>
            <td>285</td>
            <td>48</td>
        </tr>
        <!-- additional rows as above -->
        <tr>
            <th>31st January</th>
            <td>129</td>
            <td>64</td>
        </tr>
    </tbody>
        <tfoot>
        <tr>
            <td></td>
            <td>7824</td>
            <td>1241</td>
        </tr>
    </tfoot>
</table>
Date Income Expenditure
1st January 250 36
2nd January 285 48
31st January 129 64
7824 1241
1

5. Width & Spacing (outdated)

width=""400"

​ indicate the width of a table or a cell

cellpadding="10"

​ The space between the cell edge and its content

cellspacing="5"

​ The space between the cells

<table width="400" cellpadding="10" cellspacing="5">
    <tr>
        <th width="300"></th>
        <th>Withdrawn</th>
        <th>Credit</th>
        <th width="150">Balance</th>
    </tr>
    <tr>
        <th>January</th>
        <td>250.00</td>
        <td>660.50</td>
        <td>410.50</td>
    </tr>
    <tr>
        <th>February</th>
        <td>135.55</td>
        <td>895.20</td>
        <td>1170.15</td>
    </tr>
</table>
Withdrawn Credit Balance
January 250.00 660.50 410.50
February 135.55 895.20 1170.15

6. border and background (outdated)

border="2"

bgcolor="#efefef"

<table border="2" bgcolor="#efefef">
    <tr>
        <th width="150"></th>
        <th>Withdrawn</th>
        <th>Credit</th>
        <th width="150" bgcolor="#cccccc">Balance</th>
    </tr>
    <tr>
        <th>January</th>
        <td>250.00</td>
        <td>660.50</td>
        <td bgcolor="#cccccc">410.50</td>
    </tr>
    <tr>
        <th>February</th>
        <td>135.55</td>
        <td>895.20</td>
        <td bgcolor="#cccccc">1170.15</td>
    </tr>
</table>
Withdrawn Credit Balance
January 250.00 660.50 410.50
February 135.55 895.20 1170.15

(display in markdown)


2

标签:Tickets,None,895.20,04,January,410.50,250.00,HTML,Table
From: https://www.cnblogs.com/moyutime/p/17117917.html

相关文章

  • GitLab CICD Day 04 - 新增 Pipeline Job
    编写.gitlab-ci.ymlhelloworld:#Jobtags:-shell#Gitlab-runnerbefore_script:-echo"脚本执行前的任务"scrip......
  • P1004 [NOIP2000 提高组] 方格取数——四维DP板子题
    题目描述设有 N×N 的方格图 (N≤9),我们将其中的某些方格中填入正整数,而其他的方格中则放入数字 0。如下图所示(见样例):A00000000001300......
  • day08-SpringMVC底层机制简单实现-04
    SpringMVC底层机制简单实现-04https://github.com/liyuelian/springmvc-demo.git8.任务7-完成简单视图解析功能说明:通过目标方法返回的String,转发或重定向到指定页面......
  • Mybatis04 - 核心配置文件 mybatis-config.xml
    mybatis-config.xml<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEconfigurationPUBLIC"-//mybatis.org//DTDConfig3.0//EN""http://mybatis.......
  • table 布局
    ​​rowspan​​​行扩展​​rowspan="2"​​表示占据两行的高度​​colspan​​​列扩展​​colspan="2"​​表示占据两列的宽度<!DOCTYPEhtml><html><head><ti......
  • 关于DataTable的一些操作
    1.数据筛选:dt.AsEnumerable().Where(r=>r.Field<string>("Name").StartsWith("A")).FirstOrDefault(); 2.注意AsEnumerable不可连续使用,比如:varitemdata=dt.As......
  • 打开MASA Blazor的正确姿势3.1:HTML和CSS基础
    一、HTML和CSS关系HTML元素定义网页的文档结构,CSS定义网页的排版样式。这句话不好理解,通过导航栏案例领会一下(以下案例非常精彩):1、导航栏的HTML文档结构<ul><li><a......
  • 为什么leveldb/rocksdb只允许一个线程修改memtable?
    leveldb/rocksdb采用deque控制多线程只允许一个线程修改memtable,是由于memtable不存在读-写冲突(采用MVCC,保证Sequence一定不同,memtable的key就一定不同,update/delete/ins......
  • HTML_03_Images
    Images1.StoringimagesonthesitecreateafoldertostoreOnabigsite,subfolderssuchas"interface","products","news"arenecessary2.addingimages......
  • Bootstrap-table的客户端分页渲染表格
    文章目录​​一、前言:​​​​1、服务端分页地址:​​​​2、插件下载地址:​​​​二、客户端分页步骤:​​​​1、table标签:​​​​2、js渲染:​​​​2.1、表格初始化​​......