Results 1 to 5 of 5

Thread: [RESOLVED] fixed width gallery/table/grid for image based directory

  1. #1
    Join Date
    Jun 2014

    resolved [RESOLVED] fixed width gallery/table/grid for image based directory

    I am attempting to create a fixed width gallery/table with multiple columns and rows including centered captions beneath that would read left to right without borders to serve as an alphabetical image based directory. here is an example of the grid format I would like to create. any assistance, be it to a link to a tutorial or direct help would be appreciated. thanks.below is what I have so far though I have found that most are tending to steer away from tables in html in favor of ul...

    <!DOCTYPE html>
    <article class="content">
    <h1>Title of gallery</h1>
    <div class="rows">
    <img src="images/pic2.jpg" width="200" height="150" alt="pic2">
    <img src="images/pic2.jpg" width="200" height="150" alt="pic2">
    <img src="images/pic2.jpg" width="200" height="150" alt="pic2">
    <img src="images/pic2.jpg" width="200" height="150" alt="pic2"><br>
    <div class="rows"></div>
    <table width="800" height="" border="0" cellpadding="18" cellspacing="1" bgcolor="#FFFFFF" rules="none">
    <td width="146">pic1</td>
    <td width="146">pic2</td>
    <td width="146">pic3</td>
    <td width="149">pic4</td></table><br>


  2. #2
    Generally yes people are shying away from tables, but that's so they can have a non-fixed layout.

    Generally I don't think I'm seeing enough of your actual data and it's relationships to say what the 'proper' markup would be, but right now it would probably help if you closed your TR, lost the line-break for nothing after the table... and I have to ask what makes this 'tabular data' and if there's a relationship between the images and the text inside the table, why isn't ALL your data inside the table? Likewise if that's the title of the gallery and the gallery is in the table, why use a H1 to do CAPTION's job?

    I suspect (guessing a bit here) that what you have should be something more like this:
    <div class="gallery">
    	<h1>Title of Gallery</h1>
    		<img src="images/pic1.jpg" width="200" height="150" alt="pic1" />
    		<img src="images/pic2.jpg" width="200" height="150" alt="pic2" />
    		<img src="images/pic3.jpg" width="200" height="150" alt="pic3" />
    		<img src="images/pic4.jpg" width="200" height="150" alt="pic4" />
    <!-- .gallery --></div>
    Since that's really not tabular data, that would most likely be the appropriate markup. Set the outer div to float wrapping, float the inner DIV, set the span to display:block and the text alignment you want. If you had more than 4 on the page, just keep dumping them in and they'll wrap predictably if all your images are the same height.

    If they'll be varying heights, that might take a wee bit more planning.

  3. #3
    Join Date
    Jun 2014

    what i ended up with for now...thanks

    thanks for the help. for now, i ended up with this. ultimately i would like something more fluid that is less work to update as I will be adding categories but for now it will do. can always upgrade as i learn more.
    <h2>Sayulita List</h2>
    <TABLE id="tblsayulitalist">
    		<TD><img src='catimages/pic1.jpg' alt='missing' /></TD> 
    		<TD><img src='catimages/pic2.jpg' alt='missing' /></TD>
    		<TD><img src='catimages/pic3.jpg' alt='missing' /></TD>
    		<TD><img src='catimages/pic4.jpg' alt='missing' /></TD>
    		<TD><img src='catimages/pic5.jpg' alt='missing' /></TD>
    		<TD><img src='catimages/pic6.jpg' alt='missing' /></TD>
    	<TR class="categorylist"> 
    		<TD>Appliance Repair / Install</TD> 
    		<TD>Auto Repair</TD> 
    		<TD>Bicycle Repair</TD> 
    		<TD>Carpentry / Woodwork</TD> 
    		<TD><img src='catimages/pic7.jpg' alt='missing' /></TD> 
    		<TD><img src='catimages/pic8.jpg' alt='missing' /></TD>
    		<TD><img src='catimages/pic9.jpg' alt='missing' /></TD>
    		<TD><img src='catimages/pic10.jpg' alt='missing' /></TD>
    		<TD><img src='catimages/pic11.jpg' alt='missing' /></TD>
    		<TD><img src='catimages/pic12.jpg' alt='missing' /></TD>
    	<TR class="categorylist">  
    		<TD>Computer Services</TD> 
    		<TD>Cooking / Catering</TD> 
    		<TD>Electrical Work</TD> 
    		<TD>Fumigation / Pest Control</TD>
    		<TD><img src='catimages/pic13.jpg' alt='missing' /></TD> 
    		<TD><img src='catimages/pic14.jpg' alt='missing' /></TD>
    		<TD><img src='catimages/pic15.jpg' alt='missing' /></TD>
    		<TD><img src='catimages/pic16.jpg' alt='missing' /></TD>
    		<TD><img src='catimages/pic17.jpg' alt='missing' /></TD>
    		<TD><img src='catimages/pic18.jpg' alt='missing' /></TD>
    	<TR class="categorylist">
    		<TD>Pet Services</TD> 
    		<TD>Pool Services</TD> 
    		<TD>Roofing / Palapas</TD> 
    		<TD><img src='catimages/pic19.jpg' alt='missing' /></TD> 
    		<TD><img src='catimages/pic20.jpg' alt='missing' /></TD>
    		<TD><img src='catimages/pic21.jpg' alt='missing' /></TD>
    		<TD><img src='catimages/pic22.jpg' alt='missing' /></TD>
    		<TD><img src='catimages/pic23.jpg' alt='missing' /></TD>
    	<TR class="categorylist">
    		<TD>Stone / Tile Work</TD> 
    		<TD>Surfboard Repair / Building</TD>
    		<TD>Waste Management</TD> 
    		<TD>Windows / Glass</TD>
    Last edited by jedaisoul; 06-25-2014 at 04:06 PM. Reason: tidy up

  4. #4
    Join Date
    Jun 2014
    eh, that code post sucks. sorry

  5. #5
    IF you're going to use a table like that, use CAPTION instead of H2, though the name AND the image should be in the SAME TD -- your putting it into a separate TD doesn't make any sense and has no "semantic" relationship between the text and the images. You also have a perfectly good table, if you used CAPTION inside the table instead of the h2, you don't need section... NOT that you should use section if you're going to have a numbered heading since numbered headings mean the start of a section of the page -- but that's why HTML 5's nonsense <section> serves no legitimate purpose -- just like 90% or so of the rest of the "specification".

    OR at least use TH for the titles and have the TD use the HEADER attribute to point at the TH... though that would get very heavy on code VERY fast... still if you're going to use tables, there are OTHER tags that go in there other than TR and TD.

    Also, this isn't 1997, it's generally frowned upon to be using uppercase tags in your markup.

    I'd put the image AND the text inside div and float the DIV as I said before -- you wouldn't need extra dividers or anything just either float 'em, or inline-block 'em and let them land where they may.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.13420 seconds
  • Memory Usage 2,890KB
  • Queries Executed 13 (?)
More Information
Template Usage (33):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (5)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (71):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates