Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-11-2002, 03:39 AM   PM User | #1
whatever
New to the CF scene

 
Join Date: Jul 2002
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
whatever is an unknown quantity at this point
Thumbs up table width question

how do you determine the width of a table in pixels? can you do it with javascript?

for example:
<table>

<tr> waaadddddupppp </tr>
<tr> yoooooooooooo </tr>

</table>

The width of the table above is set according to the width of the row text How do you determine the width of the table in pixels?

Thanks Dude.
whatever is offline   Reply With Quote
Old 07-11-2002, 04:26 AM   PM User | #2
Feyd
Regular Coder


 
Feyd's Avatar
 
Join Date: May 2002
Location: Los Angeles, CA Maxim: Subvert Society
Posts: 404
Thanks: 0
Thanked 0 Times in 0 Posts
Feyd is an unknown quantity at this point
Code:
<table border="0" cellpadding="0" cellspacing="0" width="745" summary="745 pixel wide table">
	<tr>
		<td width="345">345 pixel wide cell</td>
		<td width="400">400 pixel wide cell</td>
	</tr>
	<tr>
		<td colspan="2" width="745" height="120">745px wide, 120px high cell spanning two columns</td>
	</tr>
</table>
__________________
Moderator, Perl/CGI Forum
shadowstorm.net - subvert society
Feyd is offline   Reply With Quote
Old 07-11-2002, 04:54 AM   PM User | #3
adios
Senior Coder

 
Join Date: Jun 2002
Posts: 1,404
Thanks: 2
Thanked 32 Times in 32 Posts
adios is on a distinguished road
document.getElementById('myTable').offsetWidth;

<table id="myTable".......>
adios is offline   Reply With Quote
Old 07-11-2002, 03:35 PM   PM User | #4
Sk8er9547
New Coder

 
Join Date: Jun 2002
Location: Colorado
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Sk8er9547 is an unknown quantity at this point
Your table code is missing something....here's an overview of what most of the table tags do:

<table> - defines that you are starting a table
<tr> - defines a new row in your table
<td> - defines a new column in your table
</td> - ends the column
</tr> - ends the row
</table> - ends the table

To define the width of a table in pixels, just use
<table width="100 "> and change the number in red to your specifications.
__________________
-Sk8er9547
Sk8er9547 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:15 AM.


Advertisement
Log in to turn off these ads.