Html table tr inside td

匿名 (未验证) 提交于 2019-12-03 01:09:02

问题:

I am trying to create a table in HTML. I have the following design to create. I had added a inside the but somehow the table is not created as per the design.

Can anyone suggest me how I can achieve this?

I am unable to create Name1 | Price1 sections.

回答1:

You must add a full table inside the td

    
...


回答2:

Putting table into table is totally invalid approach. Also, you cannot put tr inside td. You need to use colspan and rowspan. Check this fiddle.

HTML:

Name 1 Name 2 Name 3 Name 4
ITEM 1 ITEM 2 name1 price1 ITEM 4
name2 price2
name3 price3/td>

And some CSS:

table {     border-collapse: collapse        }  td {    border: 1px solid #000000 } 


回答3:

You can solve without nesting tables.

        
ABC ABC ABC ABC
Item1 Item1 Item1 Item1
Name1 Price1
Name2 Price2
Name3 Price3
Item2 Item2 Item2 Item2


回答4:

Try this code

Name 1 Name 2 Name 3 Name 4
ITEM 1 ITEM 2 name price ITEM 4
name price
name price


回答5:

Put another table inside the td element like this.

         ...      ... 
ABC ABC ...
name1 price1
ABC


回答6:

Full Example:

   
ABC ABC ABC ABC
Item 1 Item 1
Name 1Price 1
Name 2Price 2
Name 3Price 3
Item 1
Item 2 Item 2 Item 2 Item 2
Item 3 Item 3 Item 3 Item 3


回答7:

Just add a new table in the td you want. Example: http://jsfiddle.net/AbE3Q/

ABC ABC ABC ABC
Item1 Item2
qweqweweqweqwewe
qweqweweqweqwewe
qweqweweqweqwewe
Item3


回答8:

Product quantity Price Totall
Item-1 Item-1
Name1 Price1
Name2 Price2
Name3 Price3
Name4 Price4
Item-1
Item-2 Item-2 Item-2 Item-2
Item-3 Item-3 Item-3 Item-3


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!