HTML的表格应该怎样布局


当前第2页 返回上一页

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

<!DOCTYPE html>  

<html lang="en">  

<head>  

    <meta charset="UTF-8">  

    <!-- 链接到外部样式表 -->  

    <link rel="stylesheet" href="css/mystyle.css">  

    <title>Island estaurant</title>  

</head>  

<body>  

    <table id="container">  

        <!-- 头部 -->  

        <tr>  

            <td id="header" colspan="2">  

                <h1>点菜系统</h1>  

            </td>  

        </tr>  

        <!-- 主体 -->  

        <tr>  

            <!-- 菜单 -->  

            <td id="menu">  

                <b>菜品</b><br>  

                <div id="dishes">  

                    小鸡炖蘑菇<br>  

                    家常豆腐<br>  

                    酸辣土豆丝<br>  

                </div>  

            </td>  

            <!-- 内容 -->  

            <td id="content">  

                小鸡炖蘑菇:<br>  

                幼鸡一只  

            </td>  

        </tr>  

        <!-- 尾部 -->  

        <tr>  

            <td id="footer" colspan="2">世俗孤岛的餐厅</td>  

        </tr>  

    </table>  

</body>  

</html>  

CSS 文件

/*整个点餐系统的界面*/ 

#container  

{  

    width: 600px;  

    margin: 100px;  

    /*取消单元格边框之间的边距*/ 

    border-spacing: 0;  

}  

/*点餐系统界面的头部*/ 

#header 

{  

    background-color: red;  

    text-align: center;  

}  

h1  

{  

    margin-bottom: 0px;  

}  

/*点餐系统界面的菜单*/ 

#menu 

{  

    background-color: #FFD700;  

    height: 200px;  

    width: 150px;  

}  

#dishes 

{  

    padding-top: 10px;  

    padding-left: 10px;  

    line-height: 20px;  

}  

/*点餐系统界面的菜品详情*/ 

#content  

{  

    background-color: gray;  

    height: 200px;  

    width: 450px;  

}  

/*点餐系统界面的尾部*/ 

#footer 

{  

    background-color: blue;  

    height: 25px;  

    text-align: center;  

}

相信看了这些案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!

相关阅读:

怎样让移动端的网页内容自适应

table表格中的内容溢出应该如何处理

在HTML中iframe与frame有哪些区别

以上就是HTML的表格应该怎样布局的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

Html基础图像知识详解

Html<input>标签怎么用

Html form标签name属性怎么用?form标签的name属性详解

txt怎么转换Html

Html标题在Html文档中为何重要

herf在Html中怎么跳转

Html字间距怎么调

Html下拉框怎么做

xHtmlHtml的区别是什么

Html怎么转换成pdf

更多相关阅读请进入《Html》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...