Skip to main content

Setting column width, not minimum column width

I've been working on a web page formatted for iPhone, and in this context the width of the page and the content on the page, is very important. First of all you don't want the page to be too wide, because then the text might be too small to read. But you also want the entire page to fit within the width of the screen, because no-one wants to have to scroll from side to side when reading lines of text.

So, of course, you can use a table and specify the width of cells and table, but this actually sets the minimum width - if the content is wider than the specified width, then the cell or table will expand to suit. In my case it is a long string of continuous text without spaces in, specifically a long URL.

I'm sure the wiser ones of you reading this will already be thinking CSS. Indeed, it gave me the answer. Specifically, CSS version 3, which is not supported on all browsers. Luckily iPhone's Safari browser is one of the few browsers that does support CSS3.

The answer came from searching for how to force text to wrap to a specific width, i.e. <p style="width: 900px; word-wrap: break-word"> which I found from this page:

http://www.velocityreviews.com/forums/t373091-wrap-long-url-in-table.html

Comments

Popular posts from this blog

Selecting Full on this computer may result in degraded video playback

When I attempt to import Full 1920x1080 video into iMovie '08 on my MacBook, it tells me "Selecting Full on this computer may result in degraded video playback". It doesn't tell me, however, what I can do about it. Is it the CPU? The graphics card? RAM? The slower Firewire 400? Is there a list of Mac models that can support full 1080 resolution? Do I need to switch to Final Cut? There is a discussion on the Apple Support forums, but no answer yet...

Berkhamsted Multi-storey Car Park

Petition The premise seems to be that Berko needs more parking spaces, and that the traffic infrastructure is able to accommodate extra traffic. However, according to the council's own report , our largest car park only gets 73% full, and the Lower Kings Road already gets 93% congested at the weekday evening peak - so the traffic congestion problem is already worse than the car park utilisation, and they predict the traffic queues on Lower Kings Road will increase by about 30%. If you want to know the detail... Let's start with that first part: that Berko needs more parking spaces. Looking at the council's own Transport Assessment that they have submitted to support this planning application, it says that the railway car park gets only 73% full at its busiest hour in the week. So there are already a significant number of free spaces in Berko just a few minutes walk from the centre. And as for the Lower Kings Road car park, the report tells us this can get up to 97%