![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am trying to create an horizontal list [...] The list should expand to contain all its items. I don't want a list item to go to a "second row". |
#3
| |||
| |||
|
|
On 4 Mar, 12:18, shapper <mdmo... (AT) gmail (DOT) com> wrote: I am trying to create an horizontal list [...] The list should expand to contain all its items. I don't want a list item to go to a "second row". If "Preserve 1 × N grid layout above all else, including line- wrapping" is the most important characteristic, then use a <table>. This is the HTML element for implying this sort of grid-like behaviour. However I doubt that you _must_ avoid line-wrapping the list. In most case it should be adequate to use float on the <li> element (as you did), to give their container an adequate width, and to let the browser deal with the rest. It will wrap eventually, but only when it's a very long list in a very small container, at which point a grid- like layout would have been forced to scroll or truncate anyway. Make sure you use colspan on the <th> that contains the list and don't use excessive margins or padding. |
#4
| |||
| |||
|
|
On Mar 4, 2:00 pm, Andy Dingley <ding... (AT) codesmiths (DOT) com> wrote: On 4 Mar, 12:18, shapper <mdmo... (AT) gmail (DOT) com> wrote: I am trying to create an horizontal list [...] The list should expand to contain all its items. I don't want a list item to go to a "second row". If "Preserve 1 × N grid layout above all else, including line- wrapping" is the most important characteristic, then use a <table>. This is the HTML element for implying this sort of grid-like behaviour. However I doubt that you _must_ avoid line-wrapping the list. In most case it should be adequate to use float on the <li> element (as you did), to give their container an adequate width, and to let the browser deal with the rest. It will wrap eventually, but only when it's a very long list in a very small container, at which point a grid- like layout would have been forced to scroll or truncate anyway. Make sure you use colspan on the <th> that contains the list and don't use excessive margins or padding. Hello, My pager HTML code is as follows: ul class="Pager" li><a href="..."><<</a></li li><a href="..."><</a></li li><a href="...">1</a></li li><a href="...">2</a></li /ul And I am using the following CSS: ul.Pager { display: table; list-style: none; margin: 0px auto; padding: 0px; text-align: center; width: auto;} ul.Pager li { display: table-cell; list-style: none; padding-right: 5px;} ul.Pager li a { background: url(../Images/PagerButton_Background.jpg) repeat-x; border: 1px solid #D4D4D4; color: #A0A0A0; cursor: pointer; display: block; font: bold 70% helvetica, sans-serif, verdana, arial; outline: none; padding: 4px 0px 4px 0px; text-decoration: none; width: 1.8em; } It looks fine. Not sure if it is the best way but it is working. Thanks, Miguel |
#5
| |||
| |||
|
|
ul.Pager li { display: table-cell; It looks fine. Not sure if it is the best way but it is working. |
#6
| |||
| |||
|
|
shapper wrote: shapper wrote: ul.Pager li a { <snip font: bold 70% helvetica, sans-serif, verdana, arial; ... It looks fine. Not sure if it is the best way but it is working. Now it is better when resizing the browser text. I hope, because 70% is flyspeck size and likely unreadable. Any suggestion to improve my code is welcome. font: 100% Helvetica, Arial, sans-serif; The generic fallback belongs on the end. See: http://k75s.home.att.net/fontsize.html -- -bts -Friends don't let friends drive Vista |
#7
| |||
| |||
|
|
On 4 Mar, 14:39, shapper <mdmo... (AT) gmail (DOT) com> wrote: ul.Pager li { display: table-cell; It looks fine. Not sure if it is the best way but it is working. Not something I'd recommend. Support for the CSS display:table-* property values on non-<table> HTML elements isn't that good. |
#8
| |||
| |||
|
|
This was the only way I could find to make this work without using a table. |
|
I don't like tables so much ... I use it only for tabular data. |
![]() |
| Thread Tools | |
| Display Modes | |
| |