May 12, 2008

Can You Put Tables Inside Of Tables?

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > HTML, XML etc..

free web hosting

Can You Put Tables Inside Of Tables?

KansukeKojima
Well... could you? Specifically I mean can you place a <table> tag in a <td></td> tag which are already parts of tables.... if so, how do you go about doing it?


Reply

heavensounds
Yes, as far as I know this is possible and works ok - most of old sites, which did not use CSS for the layout of the page, all used nested tables or tables inside tables to create a layout.

You should know that tables are not the most preffered method of creating layouts, because they are very hard to maintain and there are also other bad sides of doing that.

If you want to create a good layout, learn CSS or cascading style sheets, because it really is worth it. Plus the concept is actually very simple once you get used to it...

Yeah, I almost forgot..how you do it (if you want to stick with nested tables):

CODE
<table>
  <tr>
    <td>
      <table>...</table>
    </td>
  </tr>
</table>

Reply

KansukeKojima
Alright haha, thanks...

By the way, I know how to use CSS, but .... I don't have the expierience or skill to create a template to use yet, I use css in conjuction with my tables... Its mostly basic css............ I should probably practice that.....

Reply

techclave
yeah you can very well use a nested table.

by the way heavensounds is right. CSS is a far better alternative to styling.

good luck!

Reply

galexcd
Yes of course you can... I use nested tables for a lot of stuff. Not a big fan of div layers and I believe css should be for setting colors and styles and stuff not actually constructing the whole template with it. I would use colspan and rowspan because that way i would be able to do everything I could do with a nested table except do it all with one table, but I've found firefox gets very confused when you get a little too excited with it. Almost all of my layouts that i try to do with one table with the help of colspan and rowspan looks great in safari, camino, and *gulp* (as much as I hate to say it) IE, but firefox messes them all up. Sigh, I'm still on the search for the perfect browser...

Reply

crazyfray
Yes, you can, but it means you're damned for eternity tongue.gif

Bear in mind that tables for layout brings many other problems rather than just difficult to read code, such as broken layouts whenever either the user stylesheet or the browser stylesheet (which shouldn't, but is known to with some of the more cheeky browsers) overrides your 'borders=0'. If nothing else, try using Lynx (a popular screen reader) to 'hear' your site - not only is this how many partially sighted and all blind users interact with your sight, but it makes it clear how your code is semantically incomprehensible.

Also, if your code renders correctly in those browsers, and not Firefox (and more conspicuously, Opera) then you are relying on the incorrect display of those browsers. Not that there's anything wrong with catering for IE and its ~80% market share, but it's pretty well known that you can write valid xhtml (even transitional 1.0) according to the w3c specifications that IE cannot render correctly. If nothing else, as soon as you play with margins and padding you can bet your bottom dollar that IE has it wrong thanks to MS's flawed interpretation of the box model.

I'm sure you already knew that Alex, but it winds me up sometimes when people code for IE, and then moan about FF and Opera...almost as much as people that spout standards-compliance on one hand, and then code for IE (not that you were doing either of those smile.gif ).

Anyway, I've fallen off topic. Tables are superb for displaying data, and are unfortunately being avoided by many for this thanks to the general bad press they get for layouts. However, that doesn't change the fact that using them for layout is bad practice, and getting into the form/function separation that CSS should teach you is a good habit for the long term. I think this is relevant, because the majority of situations I've seen where nested tables are used are cases where a table shouldn't be used at all - your table either needs additional columns/rows which are 'joined' by col/rowspan as Alex pointed out, or you should have just the data you want to nest in a table located within a div.

That's my 2 cents - I do appreciate that the jury is still out on table usage, but I'm not a big fan - I'm sure it can be done well, but not as easily once someone knows an equivalent level of CSS.

 

 

 


Reply

KansukeKojima
Thanks for your opinion... I was only planning on using nested tables for my portfolio... so when the page loads, the image is displayed with the text how I wanted it.... but not for my layout...

Also, for the next version of my website, I'm looking towards a css layout... I'll have to practice how to set it up though...

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : put, tables, inside, tables,

  1. Help With Tables Please
    :) (4)
  2. Advanced Html Frame Tag
    Frames and Tables (3)
    FRAME SYNTAX Frame syntax is similar in scope and complexity to that used by tables, and has been
    designed to be quickly processed by Internet client layout engines. CODE <FRAMESET>
    This is the main container for a Frame. It has 2 attributes ROWS and COLS. A frame document has
    no BODY, and no tags that would normally be placed in the BODY can appear before the FRAMESET tag,
    or the FRAMESET will be ignored. The FRAMESET tag has a matching end tag, and within the FRAMESET
    you can only have other nested FRAMESET tags, FRAME tags, or the NOFRAMES tag. ....
  3. Tables Invading Space
    (3)
    hi all ! I have 3 tables in my JSP, now the prob is that when I get some result from my server
    the tables seems to invade the other table's space, for example table number 2 goes up and gets
    to the right of table 1. (see atachments). Here is the code, all 3 tables has the same code except
    the variables. Code: CODE <table border="1" align="left"
    cellpadding="10" cellspacing="5" id="normales">        <tr>  
           <td class="style13"><div align="center" class="style22&#....
  4. Question About Tables!
    (13)
    How can I make tables on my web page to be static (always same size)? I want my page to always be
    the same size, I don't want my text to adjust to visible on the page when you make window
    smaller. I want horizontal scroll bar to appear!!! Help me!!!!....
  5. Html, Css, Tables...
    3 column, header, and possibly footer (10)
    Which one should I use to design my site with? Or mostly use anyway. Which is better for making it 3
    column, header and maybe footer? Where can I find a ready made code? /tongue.gif' border='0'
    style='vertical-align:middle' alt='tongue.gif' /> ....
  6. Optimize Html Tables For Search Engines
    how to tutorial (0)
    Perhaps you've heard that HTML tables reduce search engine optimization efficiency. The truth
    is, it isn't the HTML table layout that reduces the efficiency, it's the content order of
    appearance within the table that auses the search engine problems. Specifically, it's when
    site navigation is placed inside the first cell of the table that causes search engines to
    erroneously catalog the navigation links as the theme of your site. Simply put, site navigation
    utilizes words like Home, Products, Services, Contacts Us, About Us, Privacy Policy, etc. Such ....
  7. Highlight Tables On Mouseover
    Example Script (3)
    Heare is a good trick: Copy and paste the code below, into the of your html document: CODE
    <script> function changeto(highlightcolor){ source=event.srcElement if
    (source.tagName=="TR"||source.tagName=="TABLE") return
    while(source.tagName!="TD") source=source.parentElement if
    (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
    source.style.backgroundColor=highlightcolor } function changeback(originalcolor){ if
    (event.fromElement.contains(event.toEleme....
  8. Bg Of Tables
    (1)
    is it possible to make a smaller background for a cell in a table because it would make it easier to
    make better looking sites and are there any other way to make good looking drop down link instead of
    using the inbuilt simple technique of: Element 1 Element 2 ....

    1. Looking for put, tables, inside, tables,

Searching Video's for put, tables, inside, tables,
advertisement



Can You Put Tables Inside Of Tables?



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE