I have rows of data that I want to represent in fixed-size columns. For instance:
Name City Number
Adam Anaheim 714 555 5555
Bob Barstow 760 555 5555
... ... ...
However, sometimes one of the column data is too large to fit. If this happens, I want it to affect as few neighboring cells as possible, and not the entire row if it is not needed.
Here is what I DO want:
Name City Number
Adam Anaheim 714 555 5555
Bob Barstow 760 555 5555
Constantine Canyon 805 555 5555 # Notice how phone number is still aligned :)
Here is what I DO NOT want :
Name City Number
Adam Anaheim 714 555 5555
Bob Barstow 760 555 5555
Constantine Canyon 805 555 5555 # Notice how phone number is also shifted :(
How do I do this with HTML / CSS (without javascript)?
Here's jsbin with a non-working solution where you can play and see for yourself.
UPDATE Here is a summary of the accepted answer when you have N columns:
N-1 DIV style = "display: inline-block", N-1. DIV N-2 div, N-2. ...
, , N.