HTML Help

Discussion in 'BlackHat Lounge' started by RaoulDuke, Mar 19, 2009.

Thread Status:
Not open for further replies.
  1. RaoulDuke

    RaoulDuke Registered Member

    Joined:
    Feb 22, 2008
    Messages:
    61
    Likes Received:
    14
    Location:
    Canada
    I wasn't sure where to put this, so I put it here.
    It's been a long time since I've worked with html and I'm trying to vertically align a table inside a table. This is what I have and it's not working:
    Code:
    	<table border="3" width="500" height="500" cellpadding="10" cellspacing="10" align="center" valign="top">
    		<td>
    
    	<table border="3" cellpadding="3 cellspacing="3" width="480">
    
    			<tr>
    		<td>data</td>
    		<td>data</td>
    			</tr>			
    
    			<tr>
    		<td>data</td>
    		<td>data</td>				
    			</tr>
    	</table>
    
    Any help would be great.
     
  2. jasonac2

    jasonac2 Junior Member

    Joined:
    Nov 23, 2008
    Messages:
    119
    Likes Received:
    69
    Occupation:
    Unemployed!
    You shouldn't be using tables in 2009. Try learning Divs. But, not all of us are coders, so if you're not, then tables are fine. :)

    Here's how to do it (this isn't following your table style though.)

    Code:
    <table width="500" height="500" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td valign="top"><table width="250" border="0" cellpadding="0" cellspacing="0" align="center" style="vertical-align:top">
          <tr>
            <td>content</td>
          </tr>
        </table></td>
      </tr>
    </table>
    In short, you need to move your "valign" to the <td>.
     
    • Thanks Thanks x 1
  3. RaoulDuke

    RaoulDuke Registered Member

    Joined:
    Feb 22, 2008
    Messages:
    61
    Likes Received:
    14
    Location:
    Canada
    Thanks a lot. I'm doing a design course and we start with tables. Tomorrow we learn CSS :)
     
  4. jasonac2

    jasonac2 Junior Member

    Joined:
    Nov 23, 2008
    Messages:
    119
    Likes Received:
    69
    Occupation:
    Unemployed!
    Ah, that makes sense. Tables are a great place to start. I worked with tables for about 5 years and when I was forced to move to divs it was VERY difficult for me - but unfortunately that's the way the industry was going.

    That's good you're taking a class, it should be very helpful. Web design is such a fun and exciting industry. Good luck!
     
  5. redarrow

    redarrow Elite Member

    Joined:
    Apr 1, 2013
    Messages:
    7,461
    Likes Received:
    1,904
    Old post but new question please.

    How do you validate html with javascript also on the same page.

    i am currently using

    https://validator.w3.org/

    validate my html , but because i got JavaScript for adsence code, it gives me a a error .

    how can i solve this.

    is there a way to stop w3, validating the javascript code...

    if i take the JavaScript code away it pass no trouble but i need the adsence code there?

    please help.....

    SOLVED

    1. <!DOCTYPE html>↩
    2. <html>↩
    3. <head><title>test</title></head>↩
    4. <body>↩
    5. <h1>JavaScript in Body</h1>↩
    6. <p id="demo">A Paragraph.</p>↩
    7. <button type="button" onclick="myFunction()">Try it</button>↩
    8. <script>↩
    9. function myFunction() {↩
    10. document.getElementById("demo").innerHTML = "Paragraph changed.";↩
    11. }↩
    12. </script>↩
    13. </body>↩
    14. </html>
     
    Last edited: Sep 10, 2016
  6. tasburrfoot

    tasburrfoot Regular Member

    Joined:
    Dec 16, 2008
    Messages:
    332
    Likes Received:
    153
    Didn't you do this yesterday too..? Start a new thread, probably in the proper section as well, and stop necro bumping
     
  7. t0mmy

    t0mmy Executive VIP Jr. VIP

    Joined:
    Jun 5, 2011
    Messages:
    6,928
    Likes Received:
    14,861
    Gender:
    Male
    Location:
    Spain
    Home Page:
    Thread locked to prevent further necrobumps
     
Thread Status:
Not open for further replies.