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...