Home Backend Development PHP Tutorial 表格内再内嵌表格,怎么让这些内嵌的表格自动换行

表格内再内嵌表格,怎么让这些内嵌的表格自动换行

Jun 13, 2016 pm 01:14 PM
gt lt table tr width

表格内再内嵌表格,如何让这些内嵌的表格自动换行
我定义了大表格为700像素的宽度,内嵌每个小表格150宽度,每行显示四个小表格后换行
代码如下:
(结果是:表格不换行,把大表格撑破了)

HTML code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
//PHP语句,从数据库select内容
Copy after login
//PHP语句这里显示从数据库中捞出的内容
//PHP语句,循环以上这个table


------解决方案--------------------
1、在无 css 控制时,table 不会被平行放置。所以你的示例代码与问题描述不符
2、假定你已经做了控制,那么 4 个 table 只占 600,绝无超出 700 的可能。应该是你换行控制有问题
HTML code
Copy after login
a
a
a
a
a
a

------解决方案--------------------
很明显楼主没有对表格进行换行控制。

三种方法供参考:

1,换用DIV(方便很多,但是弊端是,你得重新设计你的样式表)

2,用楼上那个左浮动(弊端是,内容向左,不能居中了)

3,用PHP程序控制:每取出四个值,填入4个表后,重新一下(太方便美观了)
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What are the differences between Huawei GT3 Pro and GT4? What are the differences between Huawei GT3 Pro and GT4? Dec 29, 2023 pm 02:27 PM

What are the differences between Huawei GT3 Pro and GT4?

Fix: Snipping tool not working in Windows 11 Fix: Snipping tool not working in Windows 11 Aug 24, 2023 am 09:48 AM

Fix: Snipping tool not working in Windows 11

How to Fix Can't Connect to App Store Error on iPhone How to Fix Can't Connect to App Store Error on iPhone Jul 29, 2023 am 08:22 AM

How to Fix Can't Connect to App Store Error on iPhone

What does the width of html mean? What does the width of html mean? Jun 03, 2021 pm 02:15 PM

What does the width of html mean?

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决

Is watch4pro better or gt? Is watch4pro better or gt? Sep 26, 2023 pm 02:45 PM

Is watch4pro better or gt?

What are the methods for expressing width value in css? What are the methods for expressing width value in css? Nov 13, 2023 pm 05:47 PM

What are the methods for expressing width value in css?

Is tr in php a column or a row? Is tr in php a column or a row? Aug 03, 2023 pm 02:53 PM

Is tr in php a column or a row?

See all articles