Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Align Table

Status
Not open for further replies.

L0stAngel

Programmer
May 5, 2005
58
US
Hi, How can I have a table be aligned LEFT if the resolutions width is less than 1000? And have it aligned CENTER if the resolution is more than 1000? I'm new to JS..
 
Just remember this works best if aligning a table within a table. if your table is not nested in another table then u'll have to wrap it in a SPAN or DIV tag.
Code:
alignMyTable = function (table_id)
    {
    var width = parseInt(screen.width);
    if (width<1000)
       {
       table_id.align = 'left';
       } else
       {
       table_id.align = 'center';
       } 
    }

---------------------------
WORD OR VOTE TO THE WISE IS ENUFF...;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top