Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9

Thread: Centre table

  1. #1
    New to the CF scene
    Join Date
    Jun 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Centre table

    Hi, im making a website for college as part of my assignment. Im using adobe dreamweaver. So i inserted a table and right click and allign centre, then insert image inside the table and save the page, when i validate it, it shows this error.

    Code:
    Line 10, Column 12: there is no attribute "align"
    
    <div align="center">
    This is the page

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <link href="style.css" rel="stylesheet" type="text/css" />
    </head>
    
    <body>
    <div align="center">
      <table width="1000" border="0">
        <tr>
          <th scope="col"><img src="images/logo.jpg" alt="" width="1000" height="250" /></th>
        </tr>
      </table>
    </div>
    <div align="center">
      <table width="1000" border="0">
        <tr>
          <th scope="col"><img src="images/car logos.png" alt="" width="1000" height="75" /></th>
        </tr>
      </table>
    </div>
    <p>&nbsp;</p>
    </body>
    </html>

  • #2
    Regular Coder dan-dan's Avatar
    Join Date
    Aug 2009
    Location
    England
    Posts
    483
    Thanks
    22
    Thanked 79 Times in 78 Posts
    Asking help online for a college assignment? I think someome's being naughty tut tut.
    Logic will get you from A to B. Imagination will take you everywhere.
    Albert Einstein

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,619
    Thanks
    0
    Thanked 645 Times in 635 Posts
    The align attribute was part of HTML 3.2 - that was replaced in 1997 wsith HTML 4 and CSS.

    Aligning something is part of its appearance and so should be done with CSS which is why there hasn't been an HTML command to do it since 1997.

    You can align blocks in the centre by giving them a width and auto margins in the CSS.
    You can align text using text-align
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #4
    Regular Coder dan-dan's Avatar
    Join Date
    Aug 2009
    Location
    England
    Posts
    483
    Thanks
    22
    Thanked 79 Times in 78 Posts
    iBall, when I went to school not even three decades ago you kinda had to do your own homework and assignments weirdly enough, and I'm pretty sure things haven't changed that much since.

    I understand reading your text books. I understand asking your teacher for assistance. I understand researching on the internet or in a library. But to go on to a coding forum and ask coders what's wrong with your code? I think if there's a line, that might just be crossing it lol.

    Even if someone does go to one of these schools which believe in these alternative educations, I'm STILL not going to do their homework/assignments. Call me old fashioned, but I believe in justified gain.
    Logic will get you from A to B. Imagination will take you everywhere.
    Albert Einstein

  • #5
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,619
    Thanks
    0
    Thanked 645 Times in 635 Posts
    Quote Originally Posted by iBall View Post
    1. Your divs are redundant and unnecessary. Tables are block level elements and you can center them as you would any other block level element (see example below).
    In this instance the table is actually the element that shouldn't be there - the required result can be obtained by wrapping the image inside a div.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #6
    New to the CF scene
    Join Date
    Jun 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Im not asking anyone to do my work. I have already completed my website and it looks fabulous, just the way i wanted it. But unfortunately it didnt pass the w3c validator, i had to make some changes which then kinda ruined my website.

  • #7
    Regular Coder dan-dan's Avatar
    Join Date
    Aug 2009
    Location
    England
    Posts
    483
    Thanks
    22
    Thanked 79 Times in 78 Posts
    But asking someone for help on a particular issue on a website is no different to asking someone face to face or consulting a book.
    It's very different from consulting a book. Consulting a book is called research! Reading books or e-type literature is a big part of study. Asking someone for the answer is exactly that, no explanation needed. Asking a teacher for help isn't even always an option, depending on the type of assignment.

    Even helping with a specific issue, that isn't what you've done, now or previously with other members. Felgall gave an explaination of what's wrong, whereas you rewrote their code... their assignment!

    Shocking that you can't see what's wrong there, it really is!

    It's members actually doing the homework for others that is frowned upon my the mods., but it is not against the forum rules.
    I've never once said it was against the forum rules, so I'm baffled as to why you've said that again. All I've spoken of is my distaste. And all because something isn't against the rules doesn't mean it's right.

    No-one in this thread has done the homework for the op and the posted information can easily be found in books, other websites and by asking other web developers face to face.
    All because you haven't completed their assignment from start to finish doesn't mean you haven't done it in part. As already mentioned, you rewrote part of their code which they may not have had the skill to do for themselves.

    And that is exactly what should have been done: Researched the error in a book or on the internet. Taken some initiative and found out the problem for themselves.

    Anyways, I'm done here. So I'll continue to believe students should do their own work while you continue to do it for them.
    Logic will get you from A to B. Imagination will take you everywhere.
    Albert Einstein

  • #8
    Regular Coder
    Join Date
    Jul 2008
    Posts
    157
    Thanks
    9
    Thanked 13 Times in 13 Posts

    Horray for DREAMWEAVER!

    It puzzles me why hunks, who think libraries like jQuery (that do half the work for you) are great, hammer down on a tool like Dreamweaver.

    You have to start somewhere. I see professors of introductory Web site development courses using <TABLE>s for starters. After you get the basics of HTML mark-up structure under your belt, you move on to the complexities and possibilities of CSS for appearance.

    For a nifty Dreamweaver time-saving and typo-avoiding assist, hit the space-bar inside opening tag to get drop-down list of possible attributes -- such as align -- click attribute for next drop-down of possible values. Or use CSS margin-right: auto and margin-left: auto to center block-level elements.

    Code:
    <table align="center" width="200" border="1">
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>

  • #9
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,619
    Thanks
    0
    Thanked 645 Times in 635 Posts
    There's nothing wrong with using DreamWeaver as long as you work mainly in code view. I know of lots of professionals who use it who never use the WHSIWYAG interface.

    There's also nothing wrong with using jQuery as long as you have sufficient understanding of JavaScript to know what parts of your script should use it and what parts should not. If you could write the script without using jQuery then you know enogh JavaScript to use jQuery properly.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

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