php - Display list items in columns versus rows -
my current wordpress page has following relevant code:
<?php $attorneys = get_posts(array( 'post_type' => 'attorney', 'numberposts' => -1, 'orderby' => 'meta_value', 'meta_key' => '_attorney_last_name', 'order' => 'asc' )); $number_of_attorneys = count($attorneys); ?> <ul> <?php foreach($attorneys $attorney) : ?> <li> <a href="<?php echo get_permalink($attorney->id); ?>"> <?php echo $attorney->post_title; ?> </a> </li> <?php endforeach; ?> </ul>
this displays results follows:
attorney attorney b attorney c attorney d attorney e attorney f attorney g attorney h attorney etc.
what correct procedure display results in 3 columns versus rows?
like...
attorney attorney d attorney g attorney b attorney e attorney h attorney c attorney f attorney
and possible spread results evenly if have, example, 30 results, there 10 results per column?
the css div
code contained within (div name team
) follows:
.post .team ul { list-style-type: disc; color: #007ff1; margin-left: 0px; } .post .team ul + ul { margin-left: 30px; } .post .team ul li { padding-bottom: 10px; float: left; margin-right: 20px; width: 175px; list-style-position: inside;} .post .team ul li:nth-child(3n) { margin-right: 0px; } .post .team ul li { color: #007ff1; font-size: 18px; line-height: 20px; }
Comments
Post a Comment