Re: Table Width Formula

by "Comharsa" <comharsa(at)clara.net>

 Date:  Mon, 19 Jun 2000 23:28:51 +0100
 To:  <hwg-techniques(at)hwg.org>
 References:  matters
  todo: View Thread, Original
From: "Adrien Zamani"

>
> Hi every body,
> I have an Html Table having this properties :
> Border Size : b
> cellpadding : cp
> cellspacing : cs
> number of columns (<TD>) of a row : #cols
> Total width of columns in a row : total
>
> Is there any formula to calculate the width of this table ?

Not really as it stands as you do not have any information regarding the
width of the content in those table cells. However, if you assume that each
column contains content of equal width, and we call that "width", then it
will be something like:

total = #cols*width + (#cols+1)*b + #cols*cp*2 + (#cols-1)*cs

which can be simplified to:

total = #cols(width + b + 2cp + cs) + b - cs

I think... :-).

Brian
comharsa(at)clara.net

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA