html table overflow,Replace HTML Table with Divs

c4468b3f4df77e96b0a416fa2a870fba.png

Replace HTML Table with Divs

https://stackoverflow.com/questions/702181/replace-html-table-with-divs

55

19

Alright, I'm trying to buy into the idea that html tables should not be used, and that divs should be. However, I often have code that resembles the following

First Name:
Last Name:
Address:NYCAUSACAN

I want the labels to be aligned and I want the controls to be aligned. How would I do this without using tables?

html css html-table

sharefollow

edited Sep 23 '16 at 20:50

UcQgO.jpg?s=32&g=1

Brian Tompsett - 汤莱恩

4,7741414 gold badges4242 silver badges113113 bronze badges

asked Mar 31 '09 at 17:39

6bf322edcddb62c64ca91df10a1e2113.png

Jacob Adams

3,90633 gold badges2020 silver badges4141 bronze badges

1

Here's a good read: Prettier Accessible Forms. – Chad Birch Mar 31 '09 at 17:41

25

The way you write the recommended best practice is NOT correct. The rule reads "You should not use tables FOR LAYOUT". It does not mean never to use tables. – bortzmeyer Apr 2 '09 at 9:04

I must be having a brain fart...isn't a table a layout structure? What else can you use it for? – xr280xr Jun 22 '12 at 18:21

4

@xr280xr for organizing tabular data...? – wrongusername Jul 17 '12 at 6:44

1

@wrongusername Visually organizing tabular data right? I.E. controlling the positioning of the data so it's arranged in a tabular format. That's layout. I'm assuming "FOR LAYOUT" must mean the layout of an entire page. – xr280xr Jul 19 '12 at 18:31

show 3 more comments

6 Answers

ActiveOldestVotes

43

This ought to do the trick.

First field

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值