www.webdeveloper.com
Results 1 to 9 of 9

Thread: i need a table centered but not deprecated.

  1. #1
    Join Date
    Aug 2012
    Posts
    21

    i need a table centered but not deprecated.

    Hi.

    all i need is one table 2 cells left and a right one. easy! right? but im trying to use <div> i'm learning along the way but nothing is working right. i heard that td tr table etc etc are deprecated? so i should keep up with new coding?

    i need a table or instance that is 740px width and 425 px height.

    divided - the left cell needs a background that is LOCKED in the given area which is needing to be width of 240 and 425 by height. then the right cell can just be blank with text that starts from top left of this cell.

    the last thing i would need is for a scrollbar that will scroll only the right td (500px width) but stays 425px height unless scrolled.

    and if the whole thing can be centered? would be great!

    should i of asked in CSS forum or is this the right place?
    Thanks guys! any ideas????

  2. #2
    Join Date
    Dec 2011
    Location
    Centurion, South Africa
    Posts
    795
    Something like this?

    Code:
    <!DOCTYPE html>
    <html lang="en">
    	<head>
    		<meta charset="utf-8" />
    		<title>i need a table centered but not deprecated</title>
    	</head>
    	<body>
    
    		<div style="border: 1px solid black; width: 740px; height: 425px; margin: 0 auto; overflow: hidden;">
    			<div style="background: url(image.png) no-repeat center #080; float: left; width: 240px; height: 425px;"></div>
    			<div style="margin-left: 240px; height: 425px; overflow: hidden; overflow-y: scroll;">text that starts from top left of this cell</div>
    		</div>
    
    	</body>
    </html>
    Not really sure how you wanted the background for the left column.
    Last edited by bionoid; 08-08-2012 at 06:31 AM.

  3. #3
    Join Date
    Aug 2012
    Posts
    21
    cool, will give this a shot.

    the background is a .jpg which is the same width and height as the left cell so i guess i want the tables LOCKED so they CANNOT MOVE AT ALL. im thinking this will work!

  4. #4
    Join Date
    Aug 2012
    Posts
    21
    Hey thanks!!!!!

    it does work... it looks great! ill have to show ya when im done. and without a border may look even better.. all i need now is to color the scrollbar is that deprecated or can i?

  5. #5
    Join Date
    Dec 2011
    Location
    Centurion, South Africa
    Posts
    795
    I haven't personally styled the scrollbars before, as it only seemed like an Internet Explorer feature.
    But that doesn't mean you can't use it, all the browsers that don't support it will just ignore the rules.

  6. #6
    Join Date
    Dec 2011
    Location
    Centurion, South Africa
    Posts
    795
    Some scrollbar styles applied to the right column:

    Code:
    <!DOCTYPE html>
    <html lang="en">
    	<head>
    		<meta charset="utf-8" />
    		<title>i need a table centered but not deprecated</title>
    	</head>
    	<body>
    
    		<div style="border: 1px solid black; width: 740px; height: 425px; margin: 0 auto; overflow: hidden;">
    			<div style="background: url(image.png) no-repeat center #080; float: left; width: 240px; height: 425px;"></div>
    			<div style="margin-left: 240px; height: 425px; overflow: hidden; overflow-y: scroll; scrollbar-base-color: #9a0000; scrollbar-arrow-color: #000;">text that starts from top left of this cell</div>
    		</div>
    
    	</body>
    </html>
    The styles only seem to affect Internet Explorer, but not any other that I have.

  7. #7
    Join Date
    Aug 2012
    Posts
    21
    way cool thanks again!

  8. #8
    Join Date
    Apr 2012
    Posts
    27
    The code aligning table is right, you just need to make it bit changes like add browser compadability code.

  9. #9
    Join Date
    May 2005
    Location
    Gold Coast (MS)
    Posts
    2,219
    Quote Originally Posted by Oppression View Post
    ...all i need now is to color the scrollbar is that deprecated or can i?
    Try: FleXcroll, Flexible and Accessible Custom Scroll Bars Haven't tried this and it may not be for the default browser generated scroll bars.

Thread Information

Users Browsing this Thread

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

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



Recent Articles